diff --git a/apps/id.saladeaula.digital/app/routes/index.tsx b/apps/id.saladeaula.digital/app/routes/index.tsx index 5996842..2dbf5b6 100644 --- a/apps/id.saladeaula.digital/app/routes/index.tsx +++ b/apps/id.saladeaula.digital/app/routes/index.tsx @@ -63,21 +63,21 @@ export async function action({ request, context }: Route.ActionArgs) { }) if (r.status === 200) { - return Response.json(null, { - status: r.status, - headers: r.headers + const url = new URL(request.url) + url.pathname = '/authorize' + + 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) - url.pathname = '/authorize' - - const headers = new Headers(r.headers) - headers.set('Location', url.toString()) - - return new Response(await r.text(), { - status: 402, - headers + return Response.json(await r.json(), { + status: r.status, + headers: r.headers }) } catch (error) { console.error(error)