This commit is contained in:
Matilda Landström
2024-05-14 15:23:21 +02:00
parent a43754d624
commit 74ff37008d
3 changed files with 5 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ export async function GET(
let redirectTo: string
const returnUrl = request.headers.get("x-returnurl")
console.log("TESTTEST", returnUrl, request)
if (returnUrl) {
// Seamless login request from Current web
redirectTo = returnUrl
@@ -32,7 +33,6 @@ export async function GET(
}
redirectTo = new URL(redirectTo, env.PUBLIC_URL).href
}
// Clean up cookie from authRequired middleware
redirectHeaders = new Headers()
redirectHeaders.append(
@@ -94,7 +94,7 @@ export async function GET(
ui_locales: context.params.lang,
}
)
console.log(redirectUrl)
if (redirectUrl) {
return NextResponse.redirect(redirectUrl, {
headers: redirectHeaders,