-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: do not send confirm email when signup_double_optin is false #1794
Conversation
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.
Also, don't forget the test for the service ;-)
app/Services/User/EmailChange.php
Outdated
throw new MissingParameterException('Missing parameters'); | ||
} | ||
|
||
$user = auth()->user(); |
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.
I don't think it's a good idea that you use auth()->user()
in a service. This assumes that we call the service in the context where we are authenticated which might not be always the case.
Instead, you need to pass the user id as a parameter and then find the user, etc...
More DB queries but at least, the service is not dependant on something else.
Yes that was my intention ;) |
@djaiss tests done! |
This pull request has been automatically locked since there |
No description provided.