Skip to content

Commit

Permalink
support api refresh tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoegel committed May 12, 2024
1 parent 209ef89 commit c9b9f73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/pizza/server_api.go
Expand Up @@ -50,10 +50,12 @@ func (s *Server) HandleAPIAuth(w http.ResponseWriter, r *http.Request) {
if len(r.Form["grant_type"]) > 0 {
opt.GrantType = &r.Form["grant_type"][0]
}
if len(r.Form["refresh_token"]) > 0 {
opt.RefreshToken = &r.Form["refresh_token"][0]
}

jwt, err := s.keycloak.GetToken(context.Background(), opt)
if err != nil {
Log.Error("GetToken failure", zap.Error(err))
w.WriteHeader(http.StatusUnauthorized)
return
}
Expand Down

0 comments on commit c9b9f73

Please sign in to comment.