1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 04:28:21 +00:00

Only allow local login if password is non-empty (#5906) (#5908)

This commit is contained in:
zeripath
2019-01-30 21:46:19 +00:00
committed by Lauris BH
parent 3f802a2846
commit e5af93af20
2 changed files with 2 additions and 2 deletions

View File

@@ -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