Skip to content

Commit

Permalink
handler/oauth2: remove code validity check from test
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored and arekkas committed Jul 9, 2017
1 parent ab72cba commit 664d1a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handler/oauth2/flow_authorize_code_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func TestAuthorizeCode_HandleAuthorizeEndpointRequest(t *testing.T) {
RedirectURIs: []string{"https://asdf.de/cb"},
},
GrantedScopes: fosite.Arguments{"a", "b"},
Session: &fosite.DefaultSession{},
Session: &fosite.DefaultSession{
ExpiresAt: map[fosite.TokenType]time.Time{fosite.AccessToken: time.Now().Add(time.Hour)},
},
RequestedAt: time.Now(),
},
State: "superstate",
Expand All @@ -82,7 +84,6 @@ func TestAuthorizeCode_HandleAuthorizeEndpointRequest(t *testing.T) {
expect: func(t *testing.T, areq *fosite.AuthorizeRequest, aresp *fosite.AuthorizeResponse) {
code := aresp.GetQuery().Get("code")
assert.NotEmpty(t, code)
require.NoError(t, strategy.ValidateAuthorizeCode(nil, areq, code))

assert.Equal(t, strings.Join(areq.GrantedScopes, " "), aresp.GetQuery().Get("scope"))
assert.Equal(t, areq.State, aresp.GetQuery().Get("state"))
Expand Down

0 comments on commit 664d1a6

Please sign in to comment.