Skip to content

Commit

Permalink
"cookie, err := httputil.MakeCookieMetadata(common...." to oidc.go
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Aug 16, 2019
1 parent d4edcbe commit f87bc4a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions util/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,19 @@ func (a *ClientApp) HandleCallback(w http.ResponseWriter, r *http.Request) {
if a.secureCookie {
flags = append(flags, "Secure")
}
cookie, err := httputil.MakeCookieMetadata(common.AuthCookieName, idTokenRAW, flags...)
if err != nil {
http.Error(w, fmt.Sprintf("%v", err), http.StatusInternalServerError)
return
}
w.Header().Set("Set-Cookie", cookie)

var claims jwt.MapClaims
err = idToken.Claims(&claims)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
cookie, err := httputil.MakeCookieMetadata(common.AuthCookieName, idTokenRAW, flags...)
if err != nil {
http.Error(w, fmt.Sprintf("claims=%v, err=%v", claims, err), http.StatusInternalServerError)
return
}
w.Header().Set("Set-Cookie", cookie)

claimsJSON, _ := json.Marshal(claims)
log.Infof("Web login successful. Claims: %s", claimsJSON)
if os.Getenv(common.EnvVarSSODebug) == "1" {
Expand Down

0 comments on commit f87bc4a

Please sign in to comment.