Skip to content

Commit

Permalink
auth: a new error code for the case of password auth against no passw…
Browse files Browse the repository at this point in the history
…ord user
  • Loading branch information
mitake authored and spzala committed Jun 21, 2020
1 parent 91b1a91 commit 6f011ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion auth/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var (
ErrRoleNotFound = errors.New("auth: role not found")
ErrRoleEmpty = errors.New("auth: role name is empty")
ErrAuthFailed = errors.New("auth: authentication failed, invalid user ID or password")
ErrNoPasswordUser = errors.New("auth: authentication failed, password was given for no password user")
ErrPermissionDenied = errors.New("auth: permission denied")
ErrRoleNotGranted = errors.New("auth: role is not granted to the user")
ErrPermissionNotGranted = errors.New("auth: permission is not granted to the role")
Expand Down Expand Up @@ -360,7 +361,7 @@ func (as *authStore) CheckPassword(username, password string) (uint64, error) {
}

if user.Options != nil && user.Options.NoPassword {
return 0, ErrAuthFailed
return 0, ErrNoPasswordUser
}

return getRevision(tx), nil
Expand Down

0 comments on commit 6f011ce

Please sign in to comment.