Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/grant-types/refresh-token-grant-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RefreshTokenGrantType.prototype.getRefreshToken = function(request, client) {
}

if (token.client.id !== client.id) {
throw new InvalidGrantError('Invalid grant: refresh token is invalid');
throw new InvalidGrantError('Invalid grant: refresh token was issued to another client');
}

if (token.refreshTokenExpiresAt && !(token.refreshTokenExpiresAt instanceof Date)) {
Expand Down Expand Up @@ -130,7 +130,7 @@ RefreshTokenGrantType.prototype.revokeToken = function(token) {
return promisify(this.model.revokeToken, 1).call(this.model, token)
.then(function(status) {
if (!status) {
throw new InvalidGrantError('Invalid grant: refresh token is invalid');
throw new InvalidGrantError('Invalid grant: refresh token is invalid or could not be revoked');
}

return token;
Expand Down
4 changes: 2 additions & 2 deletions test/integration/grant-types/refresh-token-grant-type_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe('RefreshTokenGrantType integration', function() {
.then(should.fail)
.catch(function(e) {
e.should.be.an.instanceOf(InvalidGrantError);
e.message.should.equal('Invalid grant: refresh token is invalid');
e.message.should.equal('Invalid grant: refresh token was issued to another client');
});
});

Expand Down Expand Up @@ -304,7 +304,7 @@ describe('RefreshTokenGrantType integration', function() {
.then(should.fail)
.catch(function(e) {
e.should.be.an.instanceOf(InvalidGrantError);
e.message.should.equal('Invalid grant: refresh token is invalid');
e.message.should.equal('Invalid grant: refresh token was issued to another client');
});
});

Expand Down