add send cert reporting
This commit is contained in:
@@ -6,16 +6,16 @@ import { parse } from 'cookie'
|
||||
export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
const cookies = parse(request.headers.get('Cookie') || '')
|
||||
const url = new URL(request.url)
|
||||
const redirect = new URL('/', url.origin)
|
||||
const loginUrl = new URL('/', url.origin)
|
||||
const issuerUrl = new URL('/authorize', context.cloudflare.env.ISSUER_URL)
|
||||
issuerUrl.search = url.search
|
||||
redirect.search = url.search
|
||||
loginUrl.search = url.search
|
||||
|
||||
if (!cookies?.__session) {
|
||||
return new Response(null, {
|
||||
status: httpStatus.FOUND,
|
||||
headers: {
|
||||
Location: redirect.toString()
|
||||
Location: loginUrl.toString()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
return new Response(null, {
|
||||
status: httpStatus.FOUND,
|
||||
headers: {
|
||||
Location: redirect.toString()
|
||||
Location: loginUrl.toString()
|
||||
}
|
||||
})
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user