fix #911: redirect verify email visits to dashboard

This commit is contained in:
Luke Crouch 2019-05-14 15:21:21 -05:00
Родитель 3d9a1735aa
Коммит d7a3b6efda
3 изменённых файлов: 3 добавлений и 10 удалений

Просмотреть файл

@ -206,13 +206,7 @@ async function verify(req, res) {
await _verify(req);
}
res.render("subpage", {
headline: req.fluentFormat("confirmation-headline"),
subhead: req.fluentFormat("confirmation-blurb"),
title: req.fluentFormat("user-verify-title"),
whichPartial: "subpages/confirm",
emailLinks: EmailUtils.getShareByEmail(req),
});
res.redirect("/user/dashboard");
}

Просмотреть файл

@ -146,7 +146,7 @@ test("user verify request with valid token verifies user", async () => {
// Call code-under-test
await user.verify(req, resp);
expect(resp.statusCode).toEqual(200);
expect(resp.statusCode).toEqual(302);
const emailAddress = await DB.getEmailByToken(validToken);
expect(emailAddress.verified).toBeTruthy();
});
@ -189,7 +189,7 @@ test("user verify request for already verified user doesn't send extra email", a
// Call code-under-test
await user.verify(mockRequest, resp);
expect(resp.statusCode).toEqual(200);
expect(resp.statusCode).toEqual(302);
const emailAddress = await DB.getEmailByToken(alreadyVerifiedToken);
expect(emailAddress.verified).toBeTruthy();
expect(EmailUtils.sendEmail).not.toHaveBeenCalled();

Просмотреть файл

@ -1 +0,0 @@
<p>WIP // TODO : Redirect to <a href="/">User Dashboard </a>on Email Confirmation.</p>