Email verification view
https://redmine.teklia.com/issues/7318
Requires backend#1757 (closed) and backend#1758 (closed)
To better handle issues with email verification, particularly expired tokens, already verified users or Outlook's Advanced Threat Protection, we need to have the frontend handle the email verifications, and not just the VerifyEmail
API endpoint.
-
Create a new view at
/user/verify-email
. This view expects theemail
andtoken
as query params, just like the currentVerifyEmail
API endpoint. -
When either of the query parameters is not set, it should display a warning Bulma notification (not a
notifications
notification) to warn about missing parameters. -
When both parameters are set, the view should show a loading state with a
<div class="loader">
until theauth/hasInfo
getter returnstrue
, so that it can tell whether the user is logged in or not. -
When the user is not logged in, or does not yet have a verified email, the view says "To confirm your e-mail address and start using Arkindex, click the button below." and include a
is-primary
button called Verify. -
When clicking Verify, the view should call the
VerifyEmail
endpoint, sending along theemail
andtoken
from the query parameters. Note that this endpoint now uses HTTP POST. -
When this fails, a Bulma error notification is shown with the error details. This should handle the error messages returned by
VerifyEmail
for the invalid email or token. -
When this succeeds:
- If the user has a password set, the view redirects to the homepage.
- Otherwise, it redirects to the user profile page, to encourage the user to set a password.
-
When the user is already logged in and has a verified email, the view should immediately redirect with the same rules as above, without waiting for the user to click anything.