add send cert reporting

This commit is contained in:
2025-10-12 01:09:40 -03:00
parent c9438d49fb
commit 8d10f55ad2
20 changed files with 435 additions and 55 deletions

View File

@@ -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 {