Optimize callback and change login field on email change#356
Optimize callback and change login field on email change#356vinay-mittal wants to merge 1 commit intospree:mainfrom
Conversation
|
I can see another problem. |
|
Here this is described. |
|
@krzysiek1507 if we are having |
|
| 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.
@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
loginfield will only be assigned if itsnilwhich 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.