Open
Conversation
Introduce email verification prompt and add an email change flow. - SessionsController: add verify_email action and email_verified? helper (with previous enforcement commented out); add sessions/verify_email view to prompt users to verify their email. - UserDetailsController: add edit_email and update_email actions with server-side validation (presence, confirmation match, format), API::User.update_email call, and connection error handling. Returns appropriate flash messages and status codes. - Views: add user_details/edit_email.haml form and a link in user_details/show to change email. - API: register update_email custom endpoint on API::User. - Routes: add routes for edit_email/update_email on user_detail resource and verify_email route for sessions. Provides UX for unverified emails and a complete edit/update flow with validation and error handling.
Introduce email verification flow and user authentication logs. - Add EmailVerificationsController with show, resend_email and cancel_pending_email_change actions. - Add API::EmailVerification model with helper methods (verify_email, email_verification_pending?, delete_pending_email_change) and custom endpoints. - Add routes for viewing, resending and cancelling email verification. - Add view for email verification confirmation and show notification banner in user_details when a pending email change exists. - Surface user auth logs on the profile page and add API::User custom endpoint for user_auth_logs. - Add internal server error JSON builder. - Update specs and test helpers to mock the new endpoints.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
[Link to the JIRA ticket and a summary of the change.](https://crowncommercialservice.atlassian.net/browse/NRMI-289)
[Link to the JIRA ticket and a summary of the change.](https://crowncommercialservice.atlassian.net/browse/NRMI-321)
[Link to the JIRA ticket and a summary of the change.](https://crowncommercialservice.atlassian.net/browse/NRMI-171)
Why was the change made?
This PR enables users to update their email address and view a history of their last five login sessions. The update flow focuses on a direct email change with built-in validation, while the security dashboard provides visibility into recent account activity by displaying the timestamp and device info for the five most recent sessions.
Are there any dependencies required for this change?
RMI API
What type of change is it?
[ ] New feature
How was the change tested?
Ran browser test of the functionality plus rspec test.