From ccf7ba0031f0a79da650f60b7a17467a866977f3 Mon Sep 17 00:00:00 2001 From: Marsel Shayhin <18054980+phoenix-ru@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:07:41 +0200 Subject: [PATCH 1/2] fix(#896): set rawRefreshToken default value (#899) --- src/runtime/composables/local/useAuthState.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/runtime/composables/local/useAuthState.ts b/src/runtime/composables/local/useAuthState.ts index 8938dabb..06ffe561 100644 --- a/src/runtime/composables/local/useAuthState.ts +++ b/src/runtime/composables/local/useAuthState.ts @@ -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 }) From ea5dfd69dec1f9585ef6a8f2eb27e694f679549f Mon Sep 17 00:00:00 2001 From: Zoey Date: Thu, 5 Sep 2024 18:09:19 +0200 Subject: [PATCH 2/2] release: 0.9.2 (#900) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83d6f1ce..ed686c44 100644 --- a/package.json +++ b/package.json @@ -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!",