fix: include url in the email body

This commit is contained in:
2025-07-29 17:05:23 +05:30
parent 47ccbc4893
commit 9ae52d4c25

View File

@@ -55,16 +55,19 @@ export async function createUser(
await newUser.save();
const URL =
"https://" +
process.env.SERVER_DOMAIN +
"/auth/webauthn/register?token=" +
token +
"&email=" +
newUser.email;
const sent = await sendMail(
input.email,
"You have been invited to Quicker Permits.",
`Click <a href="${
process.env.SERVER_DOMAIN +
"/auth/webauthn/register?token=" +
token +
"&email=" +
newUser.email
}">here</a> to register.</p><p>The above link expires in 48 hours</p>`
`Click <a href="${URL}">here</a> to register.</p><p>The above link expires in 48 hours</p>
<p>Go to this URL is the above link doesn't work: <span>${URL}</span></p>`
);
return userModel
@@ -95,16 +98,19 @@ export async function resetUser(userId: string, user?: AuthenticatedUser) {
throw ErrUserNotFound;
}
const URL =
"https://" +
process.env.SERVER_DOMAIN +
"/auth/webauthn/register?token=" +
token +
"&email=" +
userInDb.email;
const sent = await sendMail(
userInDb.email,
"Quicker Permits account reset",
`<p>Click <a href="${
process.env.SERVER_DOMAIN +
"/auth/webauthn/register?token=" +
token +
"&email=" +
userInDb.email
}">here</a> to reset.</p><p>The above link expires in 48 hours</p>`
`<p>Click <a href="${URL}">here</a> to reset.</p><p>The above link expires in 48 hours</p>
<p>Go to this URL is the above link doesn't work: <span>${URL}</span></p>`
);
}