From fc750093d499d2063e82ef75c7a3209e89d26619 Mon Sep 17 00:00:00 2001 From: BracketJohn Date: Mon, 14 Nov 2022 00:11:01 +0800 Subject: [PATCH 1/2] fix: use parseCookies instead of undefined useCookies --- src/runtime/server/services/nuxtAuthHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/server/services/nuxtAuthHandler.ts b/src/runtime/server/services/nuxtAuthHandler.ts index 1fb68f2d..fe595b29 100644 --- a/src/runtime/server/services/nuxtAuthHandler.ts +++ b/src/runtime/server/services/nuxtAuthHandler.ts @@ -10,7 +10,7 @@ import type { GetTokenParams } from 'next-auth/jwt' import defu from 'defu' import { useRuntimeConfig } from '#imports' -let preparedAuthHandler: ReturnType | undefined +let preparedAuthHandler: ReturnType | undefined let usedSecret: string | undefined const SUPPORTED_ACTIONS: NextAuthAction[] = ['providers', 'session', 'csrf', 'signin', 'signout', 'callback', 'verify-request', 'error', '_log'] @@ -200,7 +200,7 @@ export const getServerSession = async (event: H3Event) => { export const getToken = ({ event, secureCookie, secret, ...rest }: Omit & { event: H3Event }) => nextGetToken({ // @ts-expect-error As our request is not a real next-auth request, we pass down only what's required for the method, as per code from https://github.com/nextauthjs/next-auth/blob/8387c78e3fef13350d8a8c6102caeeb05c70a650/packages/next-auth/src/jwt/index.ts#L68 req: { - cookies: useCookies(event), + cookies: parseCookies(event), headers: event.req.headers }, // see https://github.com/nextauthjs/next-auth/blob/8387c78e3fef13350d8a8c6102caeeb05c70a650/packages/next-auth/src/jwt/index.ts#L73 From 8faf3410b4e21903d1475def0ac3ec365e6a50ac Mon Sep 17 00:00:00 2001 From: BracketJohn Date: Mon, 14 Nov 2022 00:11:19 +0800 Subject: [PATCH 2/2] release: 0.0.1-beta.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index eff600f6..cb826cad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sidebase/nuxt-auth", - "version": "0.0.1-beta.6", + "version": "0.0.1-beta.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sidebase/nuxt-auth", - "version": "0.0.1-beta.6", + "version": "0.0.1-beta.7", "license": "MIT", "dependencies": { "@nuxt/kit": "^3.0.0-rc.12", diff --git a/package.json b/package.json index 14a49bfa..1640607d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sidebase/nuxt-auth", - "version": "0.0.1-beta.6", + "version": "0.0.1-beta.7", "license": "MIT", "type": "module", "exports": {