feat(SW-162): Used token instead of cookie

This commit is contained in:
Hrishikesh Vaipurkar
2024-08-09 17:45:29 +02:00
parent e7f7fb286e
commit 51df6bfd34
5 changed files with 44 additions and 70 deletions

View File

@@ -86,16 +86,34 @@ export async function GET(
console.log({ login_env: process.env })
console.log({ login_redirectTo: redirectTo })
const signInProvider = isMFA ? "curity-mfa" : "curity"
const params = isMFA
? {
ui_locales: context.params.lang,
scope: ["profile_update", "openid", "profile"].join(" "),
/**
* 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
*/
acr_values:
"urn:se:curity:authentication:otp-authenticator:OTP-Authenticator_web",
}
: {
ui_locales: context.params.lang,
scope: ["openid", "profile"].join(" "),
/**
* The `acr_values` param is used to make Curity display the proper login
* page for Scandic. Without the parameter Curity presents some choices
* to the user which we do not want.
*/
acr_values: "acr",
}
const redirectUrl = await signIn(
signInProvider,
"curity",
{
redirectTo,
redirect: false,
},
{
ui_locales: context.params.lang,
}
params
)
if (redirectUrl) {