-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove username from verification emails #8488
base: alpha
Are you sure you want to change the base?
Conversation
I will reformat the title to use the proper commit message syntax. |
Thanks for opening this pull request! |
How should this handle expired tokens? With the old implementation the I'm also wondering if removing the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alpha #8488 +/- ##
==========================================
- Coverage 93.50% 93.16% -0.34%
==========================================
Files 186 186
Lines 14804 14807 +3
==========================================
- Hits 13842 13795 -47
- Misses 962 1012 +50 ☔ View full report in Codecov by Sentry. |
What is the purpose of token expiration for email verification? If an expired token leads to a website where one can request a new token (sent via verification email) without login, the expiration seems useless. Is there any scenario in which expiration makes sense? Maybe the existing tests related to token expiration give clues about the intentions of expiration?
The difference of brute forcing two fields (email + token) vs one field (token) is just the amount of possible combinations. If we make the token a longer string, the difficulty should be the same. What happens in the following scenario:
|
This PR:
This all feels like pretty breaking changes to me, which I think we would have to phase in @mtrezza thoughts? |
Did you find out any hinds regarding:
Regarding breaking change:
|
@mtrezza , if there isn't any code that specifically checks that the username is not in the link, and if tokens still work the same way, passing an old link to a new server will succeed. That is, if all cases of |
@mathieulb That makes sense. Given that the existing tests have been changed, we'd need to maintain a test legacy test that uses the old link with username query parameter in the URL. Even though the param should be ignored, it would be good to test it. |
When you attempt to reset with an expired token, the server will throw. It's up to the client to request a renewal - previously you could do it with the email that is in the query params, but now that will no longer work (there is a new mechanism where you can submit the expired token for renewal) |
Is this new mechanism only Parse Server internal or is that a breaking change? |
This is a new mechanism, that expired tokens can be used trigger the resending of verification emails (previously you could use the email) |
Ok, but is that mechanism only internal or does it imply any changes for developers or users? |
The mechanism is public and is breaking - if users have custom invalid pages that use the email from the query params, they will have to access |
Does this have to be breaking? Could it auto-generate a new token, based on the invalid token? |
As far as I can tell, the breaking part is that the invalid link URL currently contains the username, meaning someone could build a page with a button "resend email" that automatically calls Or, they could have a templated message (e.g {{username}}, this link is invalid. |
Good point, not having the username as URL param should indeed be considered breaking. |
I’m a bit concerned about the breaking change. I think it warrants a migration document for PS7 to PS8, because describing the old vs. new process and the required changes for the developer, especially regarding the HTML files, will likely exceed a simply changelog entry. Could you please take the |
The label |
I'm wondering; how long until an expired token is deleted from the DB? Or isn't it deleted at all? If it is deleted, then this logic probably fails and the correct approach would be to present a form with an email field where the user has to enter the email address. Or, just show a website which instructs the user on how to request a new verification email from within the app, if login with unverified email is enabled. |
Pull Request
Issue
Currently, Parse Server exposes
username
via verification email urls. All that should be needed to perform a reset request is a valid tokenCloses: #7137
Approach
Tasks