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 authored and yiannistri committed Feb 25, 2022
1 parent 747d5cf commit 5f0e1f4
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 5f0e1f4

Please sign in to comment.