mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 20:51:33 +10:00
Merge branch 'documenso:feat/refresh' into feat/refresh
This commit is contained in:
@ -12,12 +12,16 @@ export const authRouter = router({
|
|||||||
|
|
||||||
return await createUser({ name, email, password, signature });
|
return await createUser({ name, email, password, signature });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
let message =
|
||||||
|
'We were unable to create your account. Please review the information you provided and try again.';
|
||||||
|
|
||||||
|
if (err instanceof Error && err.message === 'User already exists') {
|
||||||
|
message = 'User with this email already exists. Please use a different email address.';
|
||||||
|
}
|
||||||
|
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: 'BAD_REQUEST',
|
code: 'BAD_REQUEST',
|
||||||
message:
|
message,
|
||||||
'We were unable to create your account. Please review the information you provided and try again.',
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user