chore(debug): auth
This commit is contained in:
committed by
Christel Westerberg
parent
675228e4e9
commit
888c33e3b3
7
app/[lang]/(live)/(protected)/bypass/page.tsx
Normal file
7
app/[lang]/(live)/(protected)/bypass/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { auth } from "@/auth"
|
||||||
|
|
||||||
|
export default async function ByPass() {
|
||||||
|
const session = await auth()
|
||||||
|
|
||||||
|
return <pre>{JSON.stringify(session, null, 2)}</pre>
|
||||||
|
}
|
||||||
@@ -41,38 +41,38 @@ export async function GET(
|
|||||||
"redirectTo=; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/; HttpOnly; SameSite=Lax"
|
"redirectTo=; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/; HttpOnly; SameSite=Lax"
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
// Initiate the seamless login flow
|
// // Initiate the seamless login flow
|
||||||
let redirectUrlValue
|
// let redirectUrlValue
|
||||||
switch (context.params.lang) {
|
// switch (context.params.lang) {
|
||||||
case Lang.da:
|
// case Lang.da:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
// redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
||||||
break
|
// break
|
||||||
case Lang.de:
|
// case Lang.de:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_DE
|
// redirectUrlValue = env.SEAMLESS_LOGIN_DE
|
||||||
break
|
// break
|
||||||
case Lang.en:
|
// case Lang.en:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_EN
|
// redirectUrlValue = env.SEAMLESS_LOGIN_EN
|
||||||
break
|
// break
|
||||||
case Lang.fi:
|
// case Lang.fi:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_FI
|
// redirectUrlValue = env.SEAMLESS_LOGIN_FI
|
||||||
break
|
// break
|
||||||
case Lang.no:
|
// case Lang.no:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_NO
|
// redirectUrlValue = env.SEAMLESS_LOGIN_NO
|
||||||
break
|
// break
|
||||||
case Lang.sv:
|
// case Lang.sv:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_SV
|
// redirectUrlValue = env.SEAMLESS_LOGIN_SV
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
const redirectUrl = new URL(redirectUrlValue)
|
// const redirectUrl = new URL(redirectUrlValue)
|
||||||
redirectUrl.searchParams.set("returnurl", redirectTo)
|
// redirectUrl.searchParams.set("returnurl", redirectTo)
|
||||||
redirectTo = redirectUrl.toString()
|
// redirectTo = redirectUrl.toString()
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
console.error(
|
// console.error(
|
||||||
"Unable to create URL for seamless login, proceeding without it."
|
// "Unable to create URL for seamless login, proceeding without it."
|
||||||
)
|
// )
|
||||||
console.error(e)
|
// console.error(e)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user