-
-
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
GraphQL: reset password with emailed token #7290
GraphQL: reset password with emailed token #7290
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7290 +/- ##
==========================================
- Coverage 93.91% 93.90% -0.01%
==========================================
Files 179 179
Lines 13154 13168 +14
==========================================
+ Hits 12353 12365 +12
- Misses 801 803 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Please find a comment below.
Also, could you please add a test case?
@davimacedo about writing a test case, for faking email adaptor, I can see that in some test cases we are doing something like this const emailAdapter = {
sendVerificationEmail: () => {},
sendPasswordResetEmail: () => Promise.resolve(),
sendMail: () => {},
};
// reconfiguring Server
reconfigureServer({
appName: 'test',
emailAdapter: emailAdapter,
publicServerURL: 'http://localhost:8378/1',
}) But still, how we will get the token, to actually test |
Instead of
|
@davimacedo , I tried adding a test case as suggested. Please let me know if any changes are required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks all good to me! @mtrezza this is a breaking change as we are changing the name os one of the current mutations. How should we proceed with that?
@davimacedo that depends on the reason for renaming
If the change is necessary, we could give this a pass and just merge it into master. We don't have the new branch structure set up yet and it doesn't seem to merit a new Parse Server option. From |
It is actually kinda cosmetic. Let me explain. Currently we have a mutation called But, maybe, to avoid the breaking change, we could keep the current mutation with the name |
To be pragmatic, am fine either way. Actually, the current endpoints for password reset and email verification will be renamed with the new My suggestion is to not make this a breaking change for now and rename all endpoints (and mutations) in one go with Up to release |
I agree. @sadakchap would you mind to change the mutations names to |
Right, @davimacedo changed the names of mutation both in userMutation file & test also. |
* renamed "resetPassword" to "requestResetPassword" & created new "resetPassword" mutation * added new route to handle resetPassword in UsersRouter.js * updated resetPassword test to "requestResetPassword" mutation * updated "resetPassword" mutation args description * changed token arg description to rerun the tests * directly using updatePassword for resetPassword * removed handleResetPassword from UsersRouter.js file * added test case for reset Password * changed mutation names to "resetPassword" & "confirmResetPassword" * changed mutation names in test also
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 5.0.0 |
New Pull Request Checklist
Issue Description
Related issue: resetting password with emailed token
Approach
/resetPassword
that will basically call this updatePassword functionand with this, I think we should be able to complete reset password flow for GraphQL API also
TODOs before merging