mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
chore: refactor
This commit is contained in:
@ -135,11 +135,15 @@ export const profileRouter = router({
|
||||
.input(ZConfirmEmailMutationSchema)
|
||||
.mutation(async ({ input }) => {
|
||||
try {
|
||||
const { email } = input;
|
||||
const { encryptedEmail } = input;
|
||||
|
||||
const decryptedEmail = decryptSecondaryData(email);
|
||||
const decryptedEmail = decryptSecondaryData(encryptedEmail);
|
||||
|
||||
return await sendConfirmationToken({ email: decryptedEmail ?? '' }); // TODO: fix this tomorrow
|
||||
if (!decryptedEmail) {
|
||||
throw new Error('Email is required');
|
||||
}
|
||||
|
||||
return await sendConfirmationToken({ email: decryptedEmail });
|
||||
} catch (err) {
|
||||
let message = 'We were unable to send a confirmation email. Please try again.';
|
||||
|
||||
|
||||
@ -30,9 +30,9 @@ export const ZResetPasswordFormSchema = z.object({
|
||||
password: z.string().min(6),
|
||||
token: z.string().min(1),
|
||||
});
|
||||
// TODO: revisit this
|
||||
|
||||
export const ZConfirmEmailMutationSchema = z.object({
|
||||
email: z.string().min(1),
|
||||
encryptedEmail: z.string().min(1),
|
||||
});
|
||||
|
||||
export type TRetrieveUserByIdQuerySchema = z.infer<typeof ZRetrieveUserByIdQuerySchema>;
|
||||
|
||||
Reference in New Issue
Block a user