feat: Pass event information to `verifyUserEmails`
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
Closes: https://github.com/parse-community/parse-server/issues/9505
What I Did Added authContext support in getUserController to pass authentication details. Updated setEmailVerifyToken to include authContext when determining whether email verification is required.
Approach Modified getUserController to accept authContext and pass it to UserController. Updated setEmailVerifyToken to check this.authContext when calling verifyUserEmails. Ensured email verification is only triggered based on the authentication context
@mtrezza Just passed event information to verifyUserEmails function as mentioned in the feature!
🚀 Thanks for opening this pull request!
The description doesn't sound like the change that has been described in the feature. The feature was only to pass more information to the method, not to change when it will be invoked. Could you please check.
Hey @mtrezza just wanted to confirm that i am on the right track like not missing out something, i will revert this changes and only pass more information such as {action, authProvider} to the method. Something more like verifyUserEmails: (user, request) => { return request?.sessionToken?.createdWith || {}; },
@mtrezza awaiting for your suggestion!
verifyUserEmails: (user, request) => { return request?.sessionToken?.createdWith || {}; },
This looks strange, because sessionToken would be expected to be a string, i.e. the token, not an object. Just make a naming suggestion, that can be easily changed later. More importantly, add the code to pass the object to the verifyUserEmail method and add a test that verifies that.
I also suggest to update the PR description, because it seems to describe changes that are neither part of the issue, nor will they be included in this PR.
@mtrezza Hope this changes serves what has been asked for let me know if there is any area for improvement or suggestion
Hello @mtrezza any update on the latest push?
@mtrezza sorry for the formatting issue hope this will be the final push! If any changes please suggest
Hello @mtrezza what should be the next step?