Test App: logout flow
This commit is contained in:
@ -13,7 +13,6 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
ctn := container.Must(ctx)
|
||||
conf := config.Must(ctn)
|
||||
|
||||
client := oidc.Must(ctn)
|
||||
|
||||
logger.Info(
|
||||
|
@ -19,13 +19,25 @@ func serveProfilePage(w http.ResponseWriter, r *http.Request) {
|
||||
panic(errors.Wrap(err, "could not retrieve idToken"))
|
||||
}
|
||||
|
||||
claims := make(map[string]interface{})
|
||||
if err := idToken.Claims(&claims); err != nil {
|
||||
panic(errors.Wrap(err, "could not decode claims"))
|
||||
}
|
||||
|
||||
jsonIDToken, err := json.MarshalIndent(idToken, "", " ")
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "could not encode idToken"))
|
||||
}
|
||||
|
||||
jsonClaims, err := json.MarshalIndent(claims, "", " ")
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "could not encode claims"))
|
||||
}
|
||||
|
||||
data := extendTemplateData(w, r, template.Data{
|
||||
"IDToken": idToken,
|
||||
"Claims": claims,
|
||||
"JSONClaims": string(jsonClaims),
|
||||
"JSONIDToken": string(jsonIDToken),
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user