From a70c2561824857e0d7bc171850e2d7384fb714b6 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Mon, 18 Nov 2024 13:37:21 +0100 Subject: [PATCH] New attempt of solving iron-session redirect problem --- app/auth/callback/unilogin/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/auth/callback/unilogin/route.ts b/app/auth/callback/unilogin/route.ts index a1b9df6a..cca512e1 100644 --- a/app/auth/callback/unilogin/route.ts +++ b/app/auth/callback/unilogin/route.ts @@ -13,8 +13,8 @@ export interface TIntrospectionResponse extends client.IntrospectionResponse { institutionIds: string } -export async function GET(request: NextRequest, response: NextResponse) { - const session = await getSession({ request, response }) +export async function GET(request: NextRequest) { + const session = await getSession({ request, response: NextResponse.next() }) const config = await getUniloginClientConfig() const currentSearchParams = request.nextUrl.searchParams const appUrl = goConfig("app.url") @@ -116,5 +116,5 @@ export async function GET(request: NextRequest, response: NextResponse) { } // eslint-disable-next-line no-console console.log("Debug line 118") - return Response.redirect(goConfig("app.url")) + return NextResponse.redirect(`${goConfig("app.url")}/user/profile`) }