Skip to content

Commit

Permalink
Avoid panic if no oidc and not auth'd
Browse files Browse the repository at this point in the history
  • Loading branch information
foot committed Feb 24, 2022
1 parent afbe250 commit 7cdc612
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/server/auth/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ func (s *AuthServer) UserInfo() http.HandlerFunc {
return
}

if !s.oidcEnabled() {
ui := UserInfo{}
toJson(rw, ui, s.logger)
}

info, err := s.provider.UserInfo(r.Context(), oauth2.StaticTokenSource(&oauth2.Token{
AccessToken: c.Value,
}))
Expand Down

0 comments on commit 7cdc612

Please sign in to comment.