fix
This commit is contained in:
@@ -63,12 +63,6 @@ export async function action({ request, context }: Route.ActionArgs) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (r.status === 200) {
|
if (r.status === 200) {
|
||||||
return Response.json(null, {
|
|
||||||
status: r.status,
|
|
||||||
headers: r.headers
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = new URL(request.url)
|
const url = new URL(request.url)
|
||||||
url.pathname = '/authorize'
|
url.pathname = '/authorize'
|
||||||
|
|
||||||
@@ -76,9 +70,15 @@ export async function action({ request, context }: Route.ActionArgs) {
|
|||||||
headers.set('Location', url.toString())
|
headers.set('Location', url.toString())
|
||||||
|
|
||||||
return new Response(await r.text(), {
|
return new Response(await r.text(), {
|
||||||
status: 402,
|
status: 302,
|
||||||
headers
|
headers
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return Response.json(await r.json(), {
|
||||||
|
status: r.status,
|
||||||
|
headers: r.headers
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
return Response.json({}, { status: 500 })
|
return Response.json({}, { status: 500 })
|
||||||
|
|||||||
Reference in New Issue
Block a user