feat: avoid updating password with existing password

This commit is contained in:
Ephraim Atta-Duncan
2023-08-30 03:26:24 +00:00
parent 4f3970c361
commit ed6fa4dc2a

View File

@ -40,12 +40,13 @@ export const profileRouter = router({
password,
});
} catch (err) {
console.error(err);
const errorMessage = (err as { message?: string }).message;
throw new TRPCError({
code: 'BAD_REQUEST',
message:
'We were unable to update your profile. Please review the information you provided and try again.',
message: errorMessage
? errorMessage
: 'We were unable to update your profile. Please review the information you provided and try again.',
});
}
}),