Skip to content

Commit fa5a1de

Browse files
committed
Merge pull request #15 from phillipj/fix/authentication
Fix authentication by providing plex-api instance to authenticator.
2 parents 517651a + ff4a6b7 commit fa5a1de

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ PlexAPI.prototype._authenticate = function _authenticate() {
150150
return deferred.reject(new Error('Permission denied even after attempted authentication :( Wrong username and/or password maybe?'));
151151
}
152152

153-
this.authenticator.authenticate(this.options, function(err, token) {
153+
this.authenticator.authenticate(this, function(err, token) {
154154
if (err) {
155155
return deferred.reject(new Error('Authentication failed, reason: ' + err.message));
156156
}

test/authenticator-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Authenticator', function() {
7373
});
7474

7575
return api.query(ROOT_URL).then(function () {
76-
assert(authenticatorStub.calledOnce, 'authenticator was called');
76+
assert(authenticatorStub.firstCall.calledWith(api), 'authenticator was called');
7777
});
7878
});
7979

0 commit comments

Comments
 (0)