fix
This commit is contained in:
@@ -12,16 +12,11 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
loginUrl.search = url.search
|
||||
|
||||
if (!cookies?.SID) {
|
||||
return new Response(null, {
|
||||
status: 302,
|
||||
headers: {
|
||||
Location: loginUrl.toString()
|
||||
}
|
||||
})
|
||||
throw redirect(loginUrl.toString())
|
||||
}
|
||||
|
||||
if (!url.searchParams.has('client_id')) {
|
||||
throw redirect('https://scorm.eduseg.workers.dev/')
|
||||
throw redirect(context.cloudflare.env.APP_URL)
|
||||
}
|
||||
|
||||
const r = await fetch(issuerUrl.toString(), {
|
||||
@@ -34,7 +29,7 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
})
|
||||
|
||||
if (r.status === 302) {
|
||||
return new Response(await r.text(), {
|
||||
return new Response(null, {
|
||||
status: r.status,
|
||||
headers: r.headers
|
||||
})
|
||||
@@ -45,10 +40,5 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
throw redirect(new URL('/deny', url.origin).toString())
|
||||
}
|
||||
|
||||
return new Response(null, {
|
||||
status: 302,
|
||||
headers: {
|
||||
Location: loginUrl.toString()
|
||||
}
|
||||
})
|
||||
throw redirect(loginUrl.toString())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user