update
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user