mirror of
https://github.com/bitinflow/nuxt-oauth.git
synced 2026-03-14 14:16:06 +00:00
Change endpoints.logout to nullable
Add redirect_uri in logout route
This commit is contained in:
@@ -45,7 +45,17 @@ export default async (options: ComposableOptions = {
|
||||
accessToken.value = null;
|
||||
user.value = null;
|
||||
|
||||
return navigateTo(authConfig.endpoints.logout || authConfig.redirect.logout)
|
||||
if (authConfig.endpoints.logout) {
|
||||
// create oauth logout url
|
||||
const params = new URLSearchParams({
|
||||
client_id: authConfig.clientId,
|
||||
redirect_uri: window.location.origin + authConfig.redirect.logout
|
||||
})
|
||||
|
||||
window.location.href = `${authConfig.endpoints.logout}?${params.toString()}`
|
||||
}
|
||||
|
||||
return navigateTo(authConfig.redirect.logout)
|
||||
}
|
||||
|
||||
const setBearer = async (token: string, tokenType: string, expires: number) => {
|
||||
|
||||
Reference in New Issue
Block a user