reject with unknow reason if failed to send confirmation email
This commit is contained in:
committed by
Jackson Harper
parent
1ea34bde62
commit
b98f7c6ba2
@ -99,12 +99,16 @@ export const createUser = async (input: {
|
||||
const confirmationToken = generateVerificationToken(user.id)
|
||||
const confirmationLink = `${env.client.url}/confirm-email/${confirmationToken}`
|
||||
// send email
|
||||
await sendEmail({
|
||||
const sent = await sendEmail({
|
||||
from: env.sender.message,
|
||||
to: user.email,
|
||||
subject: 'Confirm your email',
|
||||
text: `Please confirm your email by clicking the link below:\n\n${confirmationLink}\n\n`,
|
||||
})
|
||||
|
||||
if (!sent) {
|
||||
return Promise.reject({ errorCode: SignupErrorCode.Unknown })
|
||||
}
|
||||
}
|
||||
|
||||
return [user, profile]
|
||||
|
||||
Reference in New Issue
Block a user