Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Improve check from previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Skukan committed Nov 25, 2016
1 parent 4541fc8 commit de2aa81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/oauth/authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var ApiAuthRequestError = require('../error/ApiAuthRequestError');
var JwtAuthenticator = require('../jwt/jwt-authenticator');
var ScopeFactoryAuthenticator = require('../oauth/scope-factory-authenticator');
var OAuthPasswordGrantRequestAuthenticator = require('../oauth/password-grant').authenticator;
var OAuthRefreshTokenGrantRequestAuthenticator = require('../oauth/refresh-grant').authenticator;
var OAuthIdSiteTokenGrantAuthenticator = require('../oauth/id-site-grant').authenticator;
Expand Down Expand Up @@ -85,7 +86,7 @@ OAuthAuthenticator.prototype.authenticate = function authenticate(req, callback)
}
}

if (this.scopeFactory && typeof authenticator.setScopeFactory === 'function') {
if (this.scopeFactory && (authenticator instanceof ScopeFactoryAuthenticator)) {
if (!this.signingKey) {
callback(new ApiAuthRequestError({
userMessage: 'Invalid Request',
Expand Down

0 comments on commit de2aa81

Please sign in to comment.