Skip to content

Commit

Permalink
fix: Add exclude signOut fetch if "config.endpoints.signOut = false"
Browse files Browse the repository at this point in the history
  • Loading branch information
conejerock committed Dec 14, 2023
1 parent 3171771 commit 76f0c43
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/runtime/composables/refresh/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,26 @@ const signOut: SignOutFunc = async (signOutOptions) => {
rawToken.value = null
rawRefreshToken.value = null

const { path, method } = config.endpoints.signOut as {
path: string;
method:
| 'get'
| 'head'
| 'patch'
| 'post'
| 'put'
| 'delete'
| 'connect'
| 'options'
| 'trace';
const signOutConfig = config.endpoints.signOut
let res

if (signOutConfig) {
const { path, method } = config.endpoints.signOut as {
path: string;
method:
| 'get'
| 'head'
| 'patch'
| 'post'
| 'put'
| 'delete'
| 'connect'
| 'options'
| 'trace';
}
res = await _fetch(nuxt, path, { method, headers })
}

const res = await _fetch(nuxt, path, { method, headers })

const { callbackUrl, redirect = true } = signOutOptions ?? {}
if (redirect) {
await navigateTo(callbackUrl ?? (await getRequestURLWN(nuxt)))
Expand Down

0 comments on commit 76f0c43

Please sign in to comment.