Skip to content

Commit d0b575f

Browse files
committed
Merge branch 'mike/feature-add-token'
2 parents df7e028 + b2fad24 commit d0b575f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function PlexAPI(options, deprecatedPort) {
2020
this.port = deprecatedPort || opts.port || PLEX_SERVER_PORT;
2121
this.username = opts.username;
2222
this.password = opts.password;
23+
this.authToken = opts.token;
2324
this.authenticator = opts.authenticator || this._credentialsAuthenticator();
2425
this.options = opts.options || {};
2526
this.options.identifier = this.options.identifier || uuid.v4();

test/api-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ describe('Module API', function() {
5050

5151
it('should have configurable options that get sent in every request', function() {
5252
api = new PlexAPI({
53-
hostname : 'localhost',
53+
hostname : 'localhost',
54+
token : 'mock-token',
5455
options: {
5556
identifier : 'mock-identifier',
5657
product : 'mock-product',
@@ -71,7 +72,8 @@ describe('Module API', function() {
7172
'X-Plex-Device' : 'mock-device',
7273
'X-Plex-Device-Name' : 'mock-deviceName',
7374
'X-Plex-Platform' : 'mock-platform',
74-
'X-Plex-Platform-Version' : 'mock-platformVersion'
75+
'X-Plex-Platform-Version' : 'mock-platformVersion',
76+
'X-Plex-Token' : 'mock-token'
7577
}
7678
});
7779

0 commit comments

Comments
 (0)