feat: SW-162 Optimized code and updated scope

This commit is contained in:
Hrishikesh Vaipurkar
2024-07-16 16:06:09 +02:00
parent dde2b828cb
commit 77feefb1dd

View File

@@ -14,13 +14,6 @@ export async function GET(
let redirectHeaders: Headers | undefined = undefined
let redirectTo: string
const returnUrl = request.headers.get("x-returnurl")
if (returnUrl) {
// Seamless login request from Current web
redirectTo = returnUrl
} else {
// Normal login request from New web
redirectTo =
request.cookies.get("redirectTo")?.value || // Cookie gets set by authRequired middleware
request.nextUrl.searchParams.get("redirectTo") ||
@@ -40,7 +33,6 @@ export async function GET(
"set-cookie",
"redirectTo=; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/; HttpOnly; SameSite=Lax"
)
}
try {
/**
@@ -56,7 +48,7 @@ export async function GET(
},
{
ui_locales: context.params.lang,
scope: "profile_update openid",
scope: "profile_update openid profile",
// The below acr value is required as for New Web same Curity Client is used for MFA
// while in current web it is being setup using different Curity Client ID and secret
acr_values: