This commit is contained in:
2025-11-28 16:31:54 -03:00
parent 441640e8fd
commit a74334b69c

View File

@@ -63,21 +63,21 @@ export async function action({ request, context }: Route.ActionArgs) {
}) })
if (r.status === 200) { if (r.status === 200) {
return Response.json(null, { const url = new URL(request.url)
status: r.status, url.pathname = '/authorize'
headers: r.headers
const headers = new Headers(r.headers)
headers.set('Location', url.toString())
return new Response(await r.text(), {
status: 302,
headers
}) })
} }
const url = new URL(request.url) return Response.json(await r.json(), {
url.pathname = '/authorize' status: r.status,
headers: r.headers
const headers = new Headers(r.headers)
headers.set('Location', url.toString())
return new Response(await r.text(), {
status: 402,
headers
}) })
} catch (error) { } catch (error) {
console.error(error) console.error(error)