feat: SW-158 Optimized comments
This commit is contained in:
@@ -15,7 +15,8 @@ export async function GET(
|
||||
let redirectTo: string
|
||||
let loginKey: string | null
|
||||
|
||||
redirectTo = request.cookies.get("Scandic-auth.callback-url")?.value || "/" // Cookie gets set by NextAuth from login initiation
|
||||
// Set callback from Cookie set by NextAuth when intiating login
|
||||
redirectTo = request.cookies.get("Scandic-auth.callback-url")?.value || "/"
|
||||
|
||||
// Make relative URL to absolute URL
|
||||
if (redirectTo.startsWith("/")) {
|
||||
@@ -25,9 +26,10 @@ export async function GET(
|
||||
redirectTo = new URL(redirectTo, env.PUBLIC_URL).href
|
||||
}
|
||||
|
||||
// Remove Seamless login as it doesn't work with Magic link login
|
||||
// Remove Seamless login as it doesn't work with Magic link login due to different authenticators
|
||||
if (redirectTo.indexOf("updatelogin?returnurl") !== -1) {
|
||||
// Additional URL decode required as url in the query parameter is encoded twice due to passed in query param and further in cookie value.
|
||||
// Additional URL decode required as url in the query parameter is encoded twice as
|
||||
// passed in query param and further in cookie value.
|
||||
redirectTo = decodeURIComponent(
|
||||
redirectTo.substring(redirectTo.indexOf("returnurl") + 10)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user