Skip to content

Fix account sign up cancellation#6419

Merged
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/drop-users-confirmed-at-confirmation-token
May 27, 2022
Merged

Fix account sign up cancellation#6419
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/drop-users-confirmed-at-confirmation-token

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented May 26, 2022

This PR is the intersection of a couple things. Initially, the goal was to continue reducing the number of DeprecatedUserAttributes and I noticed the only place the confirmation_token on the users table was being directly queried was when cancelling account sign up. The column is already unused and null, meaning the account cancellation was not working as intended. There is also a bit of crossover with #6247 (where we were not properly validating the email confirmation token).

The combination of problems resulted in a few changes:

  1. Fixing the account cancellation to read the confirmation token from EmailAddress instead of User
  2. Adding proper validation to ensure we don't delete accounts based on on invalid token
  3. Moving the deletion route into the same controller as the route that renders the deletion form (with backwards compatibility)
  4. Removing all uses of confirmation_token and confirmation_sent_at on the users table. The tests were a bit tricky in this regard since they depended on the EmailAddressCallback functionality to copy those attributes from the User model to EmailAddress.

@mitchellhenke mitchellhenke requested a review from jmhooper May 27, 2022 13:32
@mitchellhenke mitchellhenke marked this pull request as ready for review May 27, 2022 15:26
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/drop-users-confirmed-at-confirmation-token branch from ca81e92 to 18f304d Compare May 27, 2022 19:33
changelog: Bug Fixes, Account Cancellation, Fix validation and deletion of account deletion attempts during sign up
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/drop-users-confirmed-at-confirmation-token branch from 18f304d to 0131c72 Compare May 27, 2022 20:40
@mitchellhenke mitchellhenke merged commit 7db2cfb into main May 27, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/drop-users-confirmed-at-confirmation-token branch May 27, 2022 21:27
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.

2 participants