Skip to content

Commit

Permalink
fix(#896): set rawRefreshToken default value
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru committed Sep 5, 2024
1 parent 3a5fc50 commit 282ea3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime/composables/local/useAuthState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export function useAuthState(): UseAuthStateReturn {
secure: config.refresh.token.secureCookieAttribute,
httpOnly: config.refresh.token.httpOnlyCookieAttribute
})

// Set default value if `useState` returned `null`
// https://github.com/sidebase/nuxt-auth/issues/896
if (rawRefreshToken.value === null) {
rawRefreshToken.value = _rawRefreshTokenCookie.value
}

watch(rawRefreshToken, () => {
_rawRefreshTokenCookie.value = rawRefreshToken.value
})
Expand Down

0 comments on commit 282ea3a

Please sign in to comment.