Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-service-side-access-for-local
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser authored Sep 6, 2024
2 parents 11b3dfc + ea5dfd6 commit e64d470
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sidebase/nuxt-auth",
"version": "0.9.1",
"version": "0.9.2",
"license": "MIT",
"type": "module",
"description": "Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!",
Expand Down
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 e64d470

Please sign in to comment.