From c62a84872ad36f5fcf0271fdff5f40f7150a0a7d Mon Sep 17 00:00:00 2001 From: Zir Date: Sat, 16 May 2020 09:16:10 +0100 Subject: [PATCH] Update refresh-token-grant-type.js For consistency shouldn't client.id be client.clientId? in: if (token.client.id !== client.id) { throw new InvalidGrantError('Invalid grant: refresh token is invalid'); } Keeping old format with && switch for backwards compatibility: if ((token.client.id !== client.id) && (token.client.id !== client.clientId)) { throw new InvalidGrantError('Invalid grant: refresh token is invalid'); } --- lib/grant-types/refresh-token-grant-type.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grant-types/refresh-token-grant-type.js b/lib/grant-types/refresh-token-grant-type.js index 19f9010c2..a26d1f94e 100644 --- a/lib/grant-types/refresh-token-grant-type.js +++ b/lib/grant-types/refresh-token-grant-type.js @@ -100,7 +100,7 @@ RefreshTokenGrantType.prototype.getRefreshToken = function(request, client) { throw new ServerError('Server error: `getRefreshToken()` did not return a `user` object'); } - if (token.client.id !== client.id) { + if ((token.client.id !== client.id) && (token.client.id !== client.clientId)) { throw new InvalidGrantError('Invalid grant: refresh token is invalid'); }