Skip to content

Commit

Permalink
fix: Incorrect verification link
Browse files Browse the repository at this point in the history
  • Loading branch information
plibither8 committed Nov 11, 2021
1 parent 4d10002 commit 2cd6220
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ route.post("/register", async (req: any, res, next) => {
data: { type: "EMAIL_VERIFICATION", userId: user.id },
});
log({ ...req, user }, "CREATE", "Email verification token created");
const verificationLink = `${process.env.API_BASE_URL}/auth/verify?token=${verificationToken.id}&userId=${user.email}`;
const verificationLink = `${process.env.API_BASE_URL}/auth/verify?token=${verificationToken.id}&userId=${user.id}`;
try {
// Send mail to user with verification token
await mail({
Expand All @@ -108,7 +108,11 @@ route.post("/register", async (req: any, res, next) => {
<code>${verificationLink}</code>
</p>`,
});
log({ ...req, user }, "CREATE", `Verification email sent to ${user.id}`);
log(
{ ...req, user },
"CREATE",
`Verification email sent to ${user.email}`
);
} catch (err) {
respond(res, req, 500, "There was an error sending the email");
return;
Expand Down

0 comments on commit 2cd6220

Please sign in to comment.