From 20696ba974966b0f791fddb5e3d1e49724784692 Mon Sep 17 00:00:00 2001 From: Joren Vandeweyer Date: Sat, 26 Aug 2023 14:12:41 +0200 Subject: [PATCH] switch order --- lib/grant-types/authorization-code-grant-type.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);