parent
3f802a2846
commit
e5af93af20
@ -644,7 +644,7 @@ func UserSignIn(username, password string) (*User, error) {
|
||||
if hasUser {
|
||||
switch user.LoginType {
|
||||
case LoginNoType, LoginPlain, LoginOAuth2:
|
||||
if user.ValidatePassword(password) {
|
||||
if user.IsPasswordSet() && user.ValidatePassword(password) {
|
||||
return user, nil
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@ func parseToken(authorization string) (*models.User, *models.Repository, string,
|
||||
if err != nil {
|
||||
return nil, nil, "basic", err
|
||||
}
|
||||
if !u.ValidatePassword(password) {
|
||||
if !u.IsPasswordSet() || !u.ValidatePassword(password) {
|
||||
return nil, nil, "basic", fmt.Errorf("Basic auth failed")
|
||||
}
|
||||
return u, nil, "basic", nil
|
||||
|
Loading…
Reference in New Issue
Block a user