Skip to content

Commit

Permalink
authn: login error code fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Koo <[email protected]>
  • Loading branch information
rkoo19 committed Jan 11, 2025
1 parent 67142ee commit 7fe1d0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/authn/mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,16 @@ func (m *mgr) issueToken(uid, pwd string, msg *authn.LoginMsg) (token string, co
cluACLs []*authn.CluACL
bckACLs []*authn.BckACL
)
code, err = m.db.Get(usersCollection, uid, uInfo)
_, err = m.db.Get(usersCollection, uid, uInfo)
if err != nil {
nlog.Errorln(err)
return "", code, errInvalidCredentials
return "", http.StatusUnauthorized, errInvalidCredentials
}

debug.Assert(uid == uInfo.ID, uid, " vs ", uInfo.ID)

if !isSamePassword(pwd, uInfo.Password) {
return "", http.StatusBadRequest, errInvalidCredentials
return "", http.StatusUnauthorized, errInvalidCredentials
}

// update ACLs with roles' ones
Expand Down

0 comments on commit 7fe1d0b

Please sign in to comment.