Skip to content

Extract password view setup behaviors from shared email confirmation behavior#11467

Merged
aduth merged 2 commits intomainfrom
aduth-email-confirmation-password-locals
Nov 7, 2024
Merged

Extract password view setup behaviors from shared email confirmation behavior#11467
aduth merged 2 commits intomainfrom
aduth-email-confirmation-password-locals

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Nov 7, 2024

🛠 Summary of changes

Updates shared code for email confirmation token to only be called as needed.

As mentioned in #11466, email confirmation happens across two controllers, which each individually validate the incoming confirmation token. Prior to these changes, the validation included a few things performed in both the initial email confirmation, as well as the password setup screen:

  • Assigning forbidden passwords instance variable
  • Flashing a success message

Since these are only relevant for the display of the password setup screen, the changes here move the code into the password setup controller.

📜 Testing Plan

Verify no regressions of expected behavior:

  1. Go to http://localhost:3000/
  2. Click "Create an account"
  3. Enter the email address examplelongemailaddress@example.com
  4. Confirm Rules of Use
  5. Click "Submit"
  6. In the email received, click "Confirm email address"
  7. Observe success banner indicating that you've confirmed email address and need to set up password
  8. Try submitting a "forbidden" password examplelongemailaddress@example.com
  9. Observe that you see an error message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT we weren't ever using this locals assignment, since the view references @confirmation_token directly. Locals are intended to be referenced without the @.

@aduth aduth changed the title Extract shared email confirmation behavior as needed Extract password view setup behaviors from shared email confirmation behavior Nov 7, 2024
@aduth aduth requested a review from a team November 7, 2024 14:39
@aduth aduth force-pushed the aduth-email-confirmation-password-locals branch from 12df960 to ed586a4 Compare November 7, 2024 18:37
aduth added 2 commits November 7, 2024 14:08
changelog: Internal, Performance, Extract shared email confirmation behavior as needed
Probably redundant, but safer to limit impact for initial refactoring
@aduth aduth force-pushed the aduth-email-confirmation-password-locals branch from ed586a4 to 3771936 Compare November 7, 2024 19:10
@aduth aduth merged commit c78aa91 into main Nov 7, 2024
@aduth aduth deleted the aduth-email-confirmation-password-locals branch November 7, 2024 19:36
@aduth aduth mentioned this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants