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"
|
||||
)
|
||||
|
||||
try {
|
||||
// Initiate the seamless login flow
|
||||
let redirectUrlValue
|
||||
switch (context.params.lang) {
|
||||
case Lang.da:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
||||
break
|
||||
case Lang.de:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_DE
|
||||
break
|
||||
case Lang.en:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_EN
|
||||
break
|
||||
case Lang.fi:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_FI
|
||||
break
|
||||
case Lang.no:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_NO
|
||||
break
|
||||
case Lang.sv:
|
||||
redirectUrlValue = env.SEAMLESS_LOGIN_SV
|
||||
break
|
||||
}
|
||||
const redirectUrl = new URL(redirectUrlValue)
|
||||
redirectUrl.searchParams.set("returnurl", redirectTo)
|
||||
redirectTo = redirectUrl.toString()
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"Unable to create URL for seamless login, proceeding without it."
|
||||
)
|
||||
console.error(e)
|
||||
}
|
||||
// try {
|
||||
// // Initiate the seamless login flow
|
||||
// let redirectUrlValue
|
||||
// switch (context.params.lang) {
|
||||
// case Lang.da:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
||||
// break
|
||||
// case Lang.de:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_DE
|
||||
// break
|
||||
// case Lang.en:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_EN
|
||||
// break
|
||||
// case Lang.fi:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_FI
|
||||
// break
|
||||
// case Lang.no:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_NO
|
||||
// break
|
||||
// case Lang.sv:
|
||||
// redirectUrlValue = env.SEAMLESS_LOGIN_SV
|
||||
// break
|
||||
// }
|
||||
// const redirectUrl = new URL(redirectUrlValue)
|
||||
// redirectUrl.searchParams.set("returnurl", redirectTo)
|
||||
// redirectTo = redirectUrl.toString()
|
||||
// } catch (e) {
|
||||
// console.error(
|
||||
// "Unable to create URL for seamless login, proceeding without it."
|
||||
// )
|
||||
// console.error(e)
|
||||
// }
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user