Consistent error responses. Updated login page.

This commit is contained in:
Mike Cao 2025-02-20 09:57:59 -08:00
parent 88f2ac20bc
commit 4c24e54fdd
17 changed files with 170 additions and 159 deletions

View file

@ -26,7 +26,7 @@ export async function POST(request: Request) {
const user = await getUserByUsername(username, { includePassword: true });
if (!user || !checkPassword(password, user.password)) {
return unauthorized();
return unauthorized({ code: 'incorrect-username-password' });
}
const { id, role, createdAt } = user;