diff --git a/lib/grant-types/authorization-code-grant-type.js b/lib/grant-types/authorization-code-grant-type.js index ca423ef..802e45a 100644 --- a/lib/grant-types/authorization-code-grant-type.js +++ b/lib/grant-types/authorization-code-grant-type.js @@ -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);