-
Notifications
You must be signed in to change notification settings - Fork 494
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
Optimize callback and change login field on email change #356
base: main
Are you sure you want to change the base?
Optimize callback and change login field on email change #356
Conversation
I can see another problem. |
Here this is described. |
@krzysiek1507 if we are having |
|
@@ -35,7 +35,7 @@ def password_required? | |||
|
|||
def set_login | |||
# for now force login to be same as email, eventually we will make this configurable, etc. | |||
self.login ||= self.email if self.email | |||
self.login = self.email |
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.
@vinay-mittal @krzysiek1507 But then what is the meaning of keeping extra parameter as login.
Its realy good option to have login field separate, It useful in mobile to have mobile number for login parameters.
@damianlegawiec @vinay-mittal @krzysiek1507 We should allow login only using |
If required I can raise PR for uniq index on both. |
@vinay-mittal Please rebase against master & add some specs. Thanks in advance 👍 |
Issue:
Admin changes email of a user but the login field is not changed for that user. User is able to login only through old email and not able to login through new email of user.
In this callback
login
field will only be assigned if itsnil
which means at the time of user creation. On every other case this callback will run and nothing change would happen.Now, this callback will only run if email is changed and new value of email will be assigned to login.