This commit is contained in:
2025-10-30 02:54:47 -03:00
parent b0ae990c7d
commit a9433d5a57
8 changed files with 31 additions and 22 deletions

View File

@@ -21,7 +21,7 @@ import { Button } from '@/components/ui/button'
import { Checkbox } from '@/components/ui/checkbox'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import * as httpStatus from '@/lib/http-status'
import { FOUND, INTERNAL_SERVER_ERROR, OK } from './authorize'
const schema = z.object({
username: z
@@ -60,7 +60,7 @@ export async function action({ request, context }: Route.ActionArgs) {
body: JSON.stringify(formData)
})
if (r.status !== httpStatus.OK) {
if (r.status !== OK) {
return Response.json(await r.json(), {
status: r.status,
headers: r.headers
@@ -74,12 +74,12 @@ export async function action({ request, context }: Route.ActionArgs) {
headers.set('Location', url.toString())
return new Response(await r.text(), {
status: httpStatus.FOUND,
status: FOUND,
headers
})
} catch (error) {
console.error(error)
return Response.json({}, { status: httpStatus.INTERNAL_SERVER })
return Response.json({}, { status: INTERNAL_SERVER_ERROR })
}
}