-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Cleanup models.User.HashPassword #3334
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
Conversation
models/user.go
Outdated
@@ -711,7 +714,8 @@ func CreateUser(u *User) (err error) { | |||
if u.Salt, err = GetUserSalt(); err != nil { | |||
return err | |||
} | |||
u.HashPassword() | |||
tempPassword := u.Passwd | |||
u.HashPassword(tempPassword) |
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.
Why variable tempPassword
is needed?
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.
Probably isn't 🤔
LGTM except @lafriks ' comment. |
Codecov Report
@@ Coverage Diff @@
## master #3334 +/- ##
==========================================
+ Coverage 35.04% 35.05% +<.01%
==========================================
Files 280 280
Lines 40556 40553 -3
==========================================
+ Hits 14211 14214 +3
+ Misses 24239 24233 -6
Partials 2106 2106
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.
LGTM except for lafrik's note
Make LG-TM work |
Makes it deterministic even if ran twice.
Something like this would previously break the users password: