Skip to content

LG-8534: move Reset token to session#8207

Merged
mdiarra3 merged 19 commits intomainfrom
LG-8534-reset-url-stored-in-session
Apr 27, 2023
Merged

LG-8534: move Reset token to session#8207
mdiarra3 merged 19 commits intomainfrom
LG-8534-reset-url-stored-in-session

Conversation

@mdiarra3
Copy link
Contributor

@mdiarra3 mdiarra3 commented Apr 13, 2023

🎫 Ticket

LG-8534: Move reset token out of url, store in session
-->

🛠 Summary of changes

This will allow users to redirect to a url without the password as well as store the password token in the session.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

Users are properly redirected to change_password url with the token not visible anymore

Screenshot

Below is screenshot of the change password page with the new url.
Screen Shot 2023-04-18 at 9 52 48 AM

@mdiarra3 mdiarra3 marked this pull request as ready for review April 17, 2023 19:38
@aduth
Copy link
Contributor

aduth commented Apr 17, 2023

Can you add a description to the pull request? (template format, for example)

config/routes.rb Outdated
devise_scope :user do
get '/users/password/new' => 'users/reset_passwords#new', as: :new_user_password
get '/users/password/edit' => 'users/reset_passwords#edit', as: :edit_user_password
get '/users/password/change_password' => 'users/reset_passwords#change_password', as: :change_user_password
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this?

@aduth
Copy link
Contributor

aduth commented Apr 24, 2023

Sorta curious about the introduction of a feature flag. Main concern from me is that we're skipping a lot of feature test coverage until it becomes the default, which I assume we might plan to do only after it's already gone live in production?

@mdiarra3
Copy link
Contributor Author

Sorta curious about the introduction of a feature flag. Main concern from me is that we're skipping a lot of feature test coverage until it becomes the default, which I assume we might plan to do only after it's already gone live in production?

This was to protect against any weirdness taht could show mid deploy. If users are trying to confirm during the middle of the deploy i was thinking they would be stuck in a weird flow where their token is stored in the session but directed to the old instance where we are still relying on the query params to populate it. i can edit the feature tests so that we are testing this new functionality outright as well as current functionality though. good callout.

@aduth
Copy link
Contributor

aduth commented Apr 24, 2023

Gotcha, maybe we can make the default true and set false only in production? That way it's the default for the tests.

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Will there be a quick follow-on pull request to remove the feature flag we added here for the initial deploy?

)

if result.success?
session.delete(:reset_password_token) if session[:reset_password_token]
Copy link
Contributor

Choose a reason for hiding this comment

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

In the follow-up pull request which removes the feature flag, we could probably remove the conditional here. I expect it's a safe operation regardless if the value exists or not, and we should expect that it would in most (all?) cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup here is the followup PR to this #8286

@mdiarra3 mdiarra3 merged commit f60d49f into main Apr 27, 2023
@mdiarra3 mdiarra3 deleted the LG-8534-reset-url-stored-in-session branch April 27, 2023 19:52
@mdiarra3 mdiarra3 mentioned this pull request May 2, 2023
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.

4 participants