Skip to content

Commit 324e29e

Browse files
authored
update refresh-token-grant errors
Two different conditions shouldnt throw the same error
1 parent f74634c commit 324e29e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/grant-types/refresh-token-grant-type.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ RefreshTokenGrantType.prototype.getRefreshToken = function(request, client) {
101101
}
102102

103103
if (token.client.id !== client.id) {
104-
throw new InvalidGrantError('Invalid grant: refresh token is invalid');
104+
throw new InvalidGrantError('Invalid grant: refresh token is invalid because token.client.id !== client.id');
105105
}
106106

107107
if (token.refreshTokenExpiresAt && !(token.refreshTokenExpiresAt instanceof Date)) {
@@ -130,7 +130,7 @@ RefreshTokenGrantType.prototype.revokeToken = function(token) {
130130
return promisify(this.model.revokeToken, 1).call(this.model, token)
131131
.then(function(status) {
132132
if (!status) {
133-
throw new InvalidGrantError('Invalid grant: refresh token is invalid');
133+
throw new InvalidGrantError('Invalid grant: refresh token is invalid, no status');
134134
}
135135

136136
return token;

0 commit comments

Comments
 (0)