Skip to content

Commit 73b187d

Browse files
committed
chore: move array to variable
1 parent d338178 commit 73b187d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

oauth2/handler.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ const (
7070
DeviceVerificationPath = "/oauth2/device/verify"
7171
)
7272

73+
// Taken from https://github.com/ory/fosite/blob/049ed1924cd0b41f12357b0fe617530c264421ac/handler/openid/flow_explicit_auth.go#L29
74+
var oidcParameters = []string{"grant_type",
75+
"max_age",
76+
"prompt",
77+
"acr_values",
78+
"id_token_hint",
79+
"nonce",
80+
}
81+
7382
type Handler struct {
7483
r InternalRegistry
7584
c *config.DefaultProvider
@@ -784,13 +793,7 @@ func (h *Handler) performOAuth2DeviceVerificationFlow(w http.ResponseWriter, r *
784793

785794
// Update the OpenID Connect session if "openid" scope is granted
786795
if req.GetGrantedScopes().Has("openid") {
787-
err = h.r.OAuth2Storage().CreateOpenIDConnectSession(ctx, sig, req.Sanitize([]string{"grant_type",
788-
"max_age",
789-
"prompt",
790-
"acr_values",
791-
"id_token_hint",
792-
"nonce",
793-
}))
796+
err = h.r.OAuth2Storage().CreateOpenIDConnectSession(ctx, sig, req.Sanitize(oidcParameters))
794797
if err != nil {
795798
x.LogError(r, err, h.r.Logger())
796799
h.r.Writer().WriteError(w, r, err)

0 commit comments

Comments
 (0)