JULIERAJ / KIDS-FIRST-Back

KIDS FIRST 2024 MVP Backend
0 stars 1 forks source link

Feat: correct account verification flow #59

Closed AnnaSolovykh closed 3 months ago

AnnaSolovykh commented 3 months ago

Correct account verification flow

Requirements

Link Expired: The user requests to resend the verification link before the original 60-minute window expires. The first link becomes deactivated, and only the newly sent link will be valid for use. This state is activated if the user clicks on an old verification link after a new one has been sent. Upon clicking the outdated link, the user will receive an error message indicating that the link is no longer valid. The user will have the options to either check their inbox for the latest email to complete the verification process or click on "Back to Sign Up" to restart the sign-up process. => we get Link Expired layout

Link Invalid: in this state, if the user fails to click the verification link within the 60-minute window and the email has been removed from the database, verifying the account is unsuccessful. The user will be prompted to sign up again from the beginning, as the original verification process cannot be completed. => we get Something went wrong layout

Notes

Check with frontend branch feat/137/new-account-verification-design

Test Steps

To test set JWT_EMAIL_LIFETIME=5m, restart the terminal, register and within 5 min resend the verification link to email (with the resend link). The previous link should be expired. After 5 min the latest link should be invalid (smth went wrong message).

Change JWT_EMAIL_LIFETIME to 1 hour back :)))

Database Changes (if there are any)

Checklist