update id

This commit is contained in:
2025-10-30 02:02:23 -03:00
parent f284b64c60
commit 76dfc44b71
25 changed files with 103 additions and 40 deletions

View File

@@ -1,21 +1,12 @@
import type { Route } from './+types'
export async function action({ request, context }: Route.ActionArgs) {
const url = new URL(request.url)
const issuerUrl = new URL(url.pathname, context.cloudflare.env.ISSUER_URL)
const r = await fetch(issuerUrl.toString(), {
method: request.method,
headers: request.headers,
body: await request.text()
})
export const loader = proxy
export const action = proxy
return new Response(await r.text(), {
status: r.status,
headers: r.headers
})
}
export async function loader({ request, context }: Route.ActionArgs) {
async function proxy({
request,
context
}: Route.ActionArgs): Promise<Response> {
const url = new URL(request.url)
const issuerUrl = new URL(url.pathname, context.cloudflare.env.ISSUER_URL)
const r = await fetch(issuerUrl.toString(), {
@@ -23,6 +14,8 @@ export async function loader({ request, context }: Route.ActionArgs) {
headers: request.headers
})
console.log('[response]', r)
return new Response(await r.text(), {
status: r.status,
headers: r.headers