From 2c867e0b29e1533d8cb16b1c73d60eb7fd79ba7f Mon Sep 17 00:00:00 2001 From: Angelo Reale <12191809+angeloreale@users.noreply.github.com> Date: Sat, 31 Aug 2024 15:32:15 +0100 Subject: [PATCH] r009 (#61) * ar(fix) session req * ar(fix) session req --- lib/auth/constants.ts | 1 + src/app/api/v1/auth/[...nextauth]/route.ts | 2 ++ src/app/api/v1/user/route.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/lib/auth/constants.ts b/lib/auth/constants.ts index 82b3e0f..419a7a6 100644 --- a/lib/auth/constants.ts +++ b/lib/auth/constants.ts @@ -29,6 +29,7 @@ export const GetSession = async ({ cookies = '' }) => { 'Content-Type': 'application/json', Cookie: cookies, }, + next: { revalidate: 0 }, }); const session = await response.json(); return session; diff --git a/src/app/api/v1/auth/[...nextauth]/route.ts b/src/app/api/v1/auth/[...nextauth]/route.ts index c725640..dca8648 100644 --- a/src/app/api/v1/auth/[...nextauth]/route.ts +++ b/src/app/api/v1/auth/[...nextauth]/route.ts @@ -1,4 +1,6 @@ // [...nextauth].ts// auth.ts TS-Doc? import { handlers } from '@auth'; +export const fetchCache = 'force-no-store'; +export const revalidate = 0; export const dynamic = 'force-dynamic'; export const { GET, POST } = handlers; diff --git a/src/app/api/v1/user/route.ts b/src/app/api/v1/user/route.ts index ca0a64d..0af8895 100644 --- a/src/app/api/v1/user/route.ts +++ b/src/app/api/v1/user/route.ts @@ -19,6 +19,8 @@ const generateErrorResponse = (e: any, status: number) => { }; }; +export const fetchCache = 'force-no-store'; +export const revalidate = 0; export const dynamic = 'force-dynamic'; export async function POST(request: CombineRequest) {