mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
fix response error return type
This commit is contained in:
parent
460200dfef
commit
8083482ba8
12 changed files with 23 additions and 25 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
import { checkPassword, hashPassword } from '@/lib/auth';
|
||||
import { checkPassword, hashPassword } from '@/lib/password';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { json, badRequest } from '@/lib/response';
|
||||
import { getUser, updateUser } from '@/queries/prisma/user';
|
||||
|
|
@ -22,7 +22,7 @@ export async function POST(request: Request) {
|
|||
const user = await getUser(userId, { includePassword: true });
|
||||
|
||||
if (!checkPassword(currentPassword, user.password)) {
|
||||
return badRequest('Current password is incorrect');
|
||||
return badRequest({ message: 'Current password is incorrect' });
|
||||
}
|
||||
|
||||
const password = hashPassword(newPassword);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue