Skip to content

Commit

Permalink
feat: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt committed Mar 4, 2024
1 parent 58e94d0 commit b088ae3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/backend/src/api/v1/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ auth.post("/login", async (ctx: Context) => {

const body = bodySchema.safeParse(ctx.request.body)
if (!body.success) {
ctx.status = 403
ctx.body = { error: "Unauthorized", message: "Invalid email or password" }
ctx.status = 402
ctx.body = {
error: "Unauthorized",
message: "Email must be of valid format, and password must be a string",
}
return
}

Expand Down

0 comments on commit b088ae3

Please sign in to comment.