Ookma-Kyi
08/30/2022, 7:48 PMbdw429s
08/30/2022, 8:19 PMbdw429s
08/30/2022, 8:20 PMOokma-Kyi
08/30/2022, 8:34 PMindex
- verifies the userid
and token
are correct for that user and shows the form to enter a new password.
new
- verifies the form data and changes the users password if correct. Otherwise redirects the user to the previous action where the form is shown again and the error is displayed. The issue is the index
action reverifies the userid
and token
passed in via query string. I am using flash storage at the moment but, the issue is if the user refreshes the page before the password is changed the query string is lost which creates a weird situation where the app doesn't know what to do next.
Snipplet: https://gist.github.com/ookma-kyi/26486c7c2fc53600ac3afabbc7ad9e61
Reset Email:
You have requested to have your password reset. If this was you click on
the link below to reset your password. Otherwise, you can ignore this
email.
http://127.0.0.1:8080/resetpassword?user=1&token=HIQuMhCWLfgCW7k7bdw429s
08/30/2022, 9:48 PMbdw429s
08/30/2022, 9:50 PMbdw429s
08/30/2022, 9:50 PMOokma-Kyi
08/30/2022, 9:51 PMYes, flash storage is a one-time use sort of thing, but that doesn't speak to what you were planning to store in the handler.
the userid and token in case the user makes an error.
Otherwise redirects the user to the previous action where the form is shown again and the error is displayed. The issue is the index action reverifies the userid and token passed in via query string. I am using flash storage at the moment but, the issue is if the user refreshes the page before the password is changed the query string is lost which creates a weird situation where the app doesn't know what to do next.
bdw429s
08/30/2022, 9:52 PMbdw429s
08/30/2022, 9:53 PMbdw429s
08/30/2022, 9:53 PMOokma-Kyi
08/30/2022, 9:55 PMindex
. Once the form is submitted it's gone ( we're in the new
action now ) so I have to store it somewhere in case I have to pass it back to the first action index
cause it is expecting it. A hidden field seems like a good idea. Let me try to figure it out and I'll let you know how it goes.