mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
fix: minor tidying
This commit is contained in:
@ -76,7 +76,7 @@ export const PasswordForm = ({ className }: PasswordFormProps) => {
|
||||
title: 'An unknown error occurred',
|
||||
variant: 'destructive',
|
||||
description:
|
||||
'We encountered an unknown error while attempting to sign you In. Please try again later.',
|
||||
'We encountered an unknown error while attempting to update your password. Please try again later.',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ export const updatePassword = async ({ userId, password }: UpdatePasswordOptions
|
||||
const isSamePassword = await compare(password, user.password as string);
|
||||
|
||||
if (isSamePassword) {
|
||||
throw new Error('You cannot use the same password as your current password.');
|
||||
throw new Error('Your new password cannot be the same as your old password.');
|
||||
}
|
||||
|
||||
const updatedUser = await prisma.user.update({
|
||||
|
||||
@ -40,13 +40,16 @@ export const profileRouter = router({
|
||||
password,
|
||||
});
|
||||
} catch (err) {
|
||||
const errorMessage = (err as { message?: string }).message;
|
||||
let message =
|
||||
'We were unable to update your profile. Please review the information you provided and try again.';
|
||||
|
||||
if (err instanceof Error) {
|
||||
message = err.message;
|
||||
}
|
||||
|
||||
throw new TRPCError({
|
||||
code: 'BAD_REQUEST',
|
||||
message: errorMessage
|
||||
? errorMessage
|
||||
: 'We were unable to update your profile. Please review the information you provided and try again.',
|
||||
message,
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user