@ -182,7 +182,7 @@ func TestGetUser(t *testing.T) {
id: "ID-1",
token: userBadTokenDisabled,
errCode: http.StatusUnauthorized, // TODO test with custom err before merge
errCode: http.StatusUnauthorized,
}, {
@ -200,10 +200,6 @@ func (s *UserMgmtServer) getCreds(r *http.Request) (api.Creds, error) {
return api.Creds{}, err
}
if usr.Disabled {
return api.Creds{}, api.ErrorUnauthorized
isAdmin, err := s.cir.IsDexAdmin(clientID)
if err != nil {
log.Errorf("userMgmtServer: GetCreds err: %q", err)
@ -197,7 +197,7 @@ func (u *UsersAPI) ListUsers(creds Creds, maxResults int, nextPageToken string)
func (u *UsersAPI) Authorize(creds Creds) bool {
return creds.User.Admin
return creds.User.Admin && !creds.User.Disabled
func userToSchemaUser(usr user.User) schema.User {