Skip to content

Commit

Permalink
fix: revoke code before validating redirect uri
Browse files Browse the repository at this point in the history
Merge pull request #232 from jorenvandeweyer/bugfix/revoke-authorization-code-earlier-4.x thanks to @jorenvandeweyer
  • Loading branch information
jankapunkt authored Aug 26, 2023
2 parents 25c3661 + 20696ba commit c533607
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grant-types/authorization-code-grant-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ AuthorizationCodeGrantType.prototype.handle = function(request, client) {
return this.getAuthorizationCode(request, client);
})
.tap(function(code) {
return this.validateRedirectUri(request, code);
return this.revokeAuthorizationCode(code);
})
.tap(function(code) {
return this.revokeAuthorizationCode(code);
return this.validateRedirectUri(request, code);
})
.then(function(code) {
return this.saveToken(code.user, client, code.authorizationCode, code.scope);
Expand Down

0 comments on commit c533607

Please sign in to comment.