Skip to content

Commit

Permalink
chore: move array to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Feb 4, 2025
1 parent 7c25b58 commit 9c81f0f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions oauth2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ const (
DeviceVerificationPath = "/oauth2/device/verify"
)

// Taken from https://github.com/ory/fosite/blob/049ed1924cd0b41f12357b0fe617530c264421ac/handler/openid/flow_explicit_auth.go#L29
var oidcParameters = []string{"grant_type",
"max_age",
"prompt",
"acr_values",
"id_token_hint",
"nonce",
}

type Handler struct {
r InternalRegistry
c *config.DefaultProvider
Expand Down Expand Up @@ -784,13 +793,7 @@ func (h *Handler) performOAuth2DeviceVerificationFlow(w http.ResponseWriter, r *

// Update the OpenID Connect session if "openid" scope is granted
if req.GetGrantedScopes().Has("openid") {
err = h.r.OAuth2Storage().CreateOpenIDConnectSession(ctx, sig, req.Sanitize([]string{"grant_type",
"max_age",
"prompt",
"acr_values",
"id_token_hint",
"nonce",
}))
err = h.r.OAuth2Storage().CreateOpenIDConnectSession(ctx, sig, req.Sanitize(oidcParameters))
if err != nil {
x.LogError(r, err, h.r.Logger())
h.r.Writer().WriteError(w, r, err)
Expand Down

0 comments on commit 9c81f0f

Please sign in to comment.