diff --git a/lib/oauth/authenticator.js b/lib/oauth/authenticator.js index 0811312b..8d3c88c9 100644 --- a/lib/oauth/authenticator.js +++ b/lib/oauth/authenticator.js @@ -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; @@ -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',