From 15630ca83823915f82330255cf811379f978d38c Mon Sep 17 00:00:00 2001 From: Zoey Date: Sun, 25 Aug 2024 18:04:19 +0200 Subject: [PATCH 1/3] fix(#879): do not format `refresh_token` (#886) --- src/runtime/composables/local/useAuthState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/composables/local/useAuthState.ts b/src/runtime/composables/local/useAuthState.ts index 3ee01ecd..8938dabb 100644 --- a/src/runtime/composables/local/useAuthState.ts +++ b/src/runtime/composables/local/useAuthState.ts @@ -90,7 +90,7 @@ export function useAuthState(): UseAuthStateReturn { } } - const refreshToken = computed(() => formatToken(rawRefreshToken.value, config)) + const refreshToken = computed(() => rawRefreshToken.value) return { ...commonAuthState, From 8df1465c738ec1eb8e820f2dc5609d98c6f384d8 Mon Sep 17 00:00:00 2001 From: Christian Segovia Date: Sun, 25 Aug 2024 11:07:09 -0500 Subject: [PATCH 2/3] enh(#880): add signInHeaders param to SignIn (#881) Co-authored-by: Zoey --- src/runtime/composables/local/useAuth.ts | 5 +++-- src/runtime/types.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/composables/local/useAuth.ts b/src/runtime/composables/local/useAuth.ts index 6d9b8a9f..1368fe0d 100644 --- a/src/runtime/composables/local/useAuth.ts +++ b/src/runtime/composables/local/useAuth.ts @@ -14,7 +14,7 @@ import { navigateTo, nextTick, useNuxtApp, useRuntimeConfig } from '#imports' type Credentials = { username?: string, email?: string, password?: string } & Record -const signIn: SignInFunc = async (credentials, signInOptions, signInParams) => { +const signIn: SignInFunc = async (credentials, signInOptions, signInParams, signInHeaders) => { const nuxt = useNuxtApp() const runtimeConfig = await callWithNuxt(nuxt, useRuntimeConfig) @@ -23,7 +23,8 @@ const signIn: SignInFunc = async (credentials, signInOptions, const response = await _fetch>(nuxt, path, { method, body: credentials, - params: signInParams ?? {} + params: signInParams ?? {}, + headers: signInHeaders ?? {} }) const { rawToken, rawRefreshToken } = useAuthState() diff --git a/src/runtime/types.ts b/src/runtime/types.ts index 10b79cf7..17152cec 100644 --- a/src/runtime/types.ts +++ b/src/runtime/types.ts @@ -583,7 +583,8 @@ export type SignOutFunc = (options?: SignOutOptions) => Promise export type SignInFunc = ( primaryOptions: PrimarySignInOptions, signInOptions?: SecondarySignInOptions, - paramsOptions?: Record + paramsOptions?: Record, + headersOptions?: Record ) => Promise export interface ModuleOptionsNormalized extends ModuleOptions { From ae2bf092f73d079a5bf479d13bf0d37db414ee23 Mon Sep 17 00:00:00 2001 From: Zoey Date: Sun, 25 Aug 2024 18:11:34 +0200 Subject: [PATCH 3/3] release: 0.9.1 (#887) --- docs/.vitepress/routes/navbar.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.vitepress/routes/navbar.ts b/docs/.vitepress/routes/navbar.ts index 52d5bcd6..c2de2a18 100644 --- a/docs/.vitepress/routes/navbar.ts +++ b/docs/.vitepress/routes/navbar.ts @@ -44,7 +44,7 @@ export const routes: DefaultTheme.Config['nav'] = [ ], }, { - text: '0.9.0', + text: '0.9.1', items: [ { text: '0.8.2', diff --git a/package.json b/package.json index dfd57eb5..aa57cbaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sidebase/nuxt-auth", - "version": "0.9.0", + "version": "0.9.1", "license": "MIT", "type": "module", "description": "Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!",