From f692c18b0a08f492567a95205b59574d3476a1ac Mon Sep 17 00:00:00 2001 From: Ayato Date: Thu, 29 Feb 2024 23:59:36 +0900 Subject: [PATCH] Fix test --- example/server/storage/oidc.go | 4 +++- pkg/op/auth_request_test.go | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/example/server/storage/oidc.go b/example/server/storage/oidc.go index 2509f77..9cd08d9 100644 --- a/example/server/storage/oidc.go +++ b/example/server/storage/oidc.go @@ -35,6 +35,7 @@ type AuthRequest struct { UserID string Scopes []string ResponseType oidc.ResponseType + ResponseMode oidc.ResponseMode Nonce string CodeChallenge *OIDCCodeChallenge @@ -100,7 +101,7 @@ func (a *AuthRequest) GetResponseType() oidc.ResponseType { } func (a *AuthRequest) GetResponseMode() oidc.ResponseMode { - return "" // we won't handle response mode in this example + return a.ResponseMode } func (a *AuthRequest) GetScopes() []string { @@ -154,6 +155,7 @@ func authRequestToInternal(authReq *oidc.AuthRequest, userID string) *AuthReques UserID: userID, Scopes: authReq.Scopes, ResponseType: authReq.ResponseType, + ResponseMode: authReq.ResponseMode, Nonce: authReq.Nonce, CodeChallenge: &OIDCCodeChallenge{ Challenge: authReq.CodeChallenge, diff --git a/pkg/op/auth_request_test.go b/pkg/op/auth_request_test.go index f2b98ad..7a363ff 100644 --- a/pkg/op/auth_request_test.go +++ b/pkg/op/auth_request_test.go @@ -1135,8 +1135,9 @@ func TestAuthResponseCode(t *testing.T) { res: res{ wantCode: http.StatusOK, wantLocationHeader: "", - wantBody: "\n\n\n\n
\n\n\n\n\n\n
\n\n", - }}, + wantBody: "\n\n\n\n
\n\n\n\n\n\n\n
\n\n", + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {