Skip to content

Commit e1a122e

Browse files
authored
Merge branch 'main' into update-pull-request
2 parents fb7a26a + 28a785b commit e1a122e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/runtime/composables/refresh/useAuth.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,18 @@ const signOut: SignOutFunc = async (signOutOptions) => {
141141
const nuxt = useNuxtApp()
142142
const runtimeConfig = await callWithNuxt(nuxt, useRuntimeConfig)
143143
const config = useTypedBackendConfig(runtimeConfig, 'refresh')
144-
const { data, rawToken, token, rawRefreshToken } = await callWithNuxt(
144+
const { data, rawToken, token, rawRefreshToken, refreshToken } = await callWithNuxt(
145145
nuxt,
146146
useAuthState
147147
)
148148

149149
const headers = new Headers({
150150
[config.token.headerName]: token.value
151151
} as HeadersInit)
152+
153+
const refreshRequestTokenPointer = config.refreshToken.refreshRequestTokenPointer
154+
const body = objectFromJsonPointer(refreshRequestTokenPointer, refreshToken.value)
155+
152156
data.value = null
153157
rawToken.value = null
154158
rawRefreshToken.value = null
@@ -170,7 +174,7 @@ const signOut: SignOutFunc = async (signOutOptions) => {
170174
| 'options'
171175
| 'trace';
172176
}
173-
res = await _fetch(nuxt, path, { method, headers })
177+
res = await _fetch(nuxt, path, { method, headers, body: method.toLowerCase() === 'post' ? body : undefined })
174178
}
175179

176180
const { callbackUrl, redirect = true } = signOutOptions ?? {}

0 commit comments

Comments
 (0)