From 049296ca39e62956166bf465be846dce1a8e8edb Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Mon, 18 Nov 2024 09:59:40 +0100 Subject: [PATCH] Trying to use nextresponse for redirecting --- 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 4118a7e6..34f25f8e 100644 --- a/app/auth/callback/unilogin/route.ts +++ b/app/auth/callback/unilogin/route.ts @@ -1,4 +1,4 @@ -import { NextRequest } from "next/server" +import { NextRequest, NextResponse } from "next/server" import * as client from "openid-client" import goConfig from "@/lib/config/config" @@ -108,10 +108,10 @@ export async function GET(request: NextRequest) { // eslint-disable-next-line no-console console.log("Debug line 109") - return Response.redirect(`${goConfig("app.url")}/user/profile`) + return NextResponse.redirect(`${goConfig("app.url")}/user/profile`) } catch (error) { console.error(error) // TODO: Error page or redirect to login page. - return Response.redirect(goConfig("app.url")) + return NextResponse.redirect(goConfig("app.url")) } }