Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 1d02178

Browse files
authored
Merge pull request #70 from netlify/bug/fix-calling-with-single-argument
Allow `accessToken` to be specified as an option
2 parents d24300b + fe380f4 commit 1d02178

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class NetlifyAPI {
2020
userAgent: 'netlify/js-client',
2121
scheme: dfn.schemes[0],
2222
host: dfn.host,
23-
pathPrefix: dfn.basePath
23+
pathPrefix: dfn.basePath,
24+
accessToken
2425
},
2526
opts
2627
)
@@ -35,11 +36,7 @@ class NetlifyAPI {
3536
this.host = opts.host
3637
this.pathPrefix = opts.pathPrefix
3738
this.globalParams = Object.assign({}, opts.globalParams)
38-
39-
if (accessToken) {
40-
debug('Setting access token')
41-
this.accessToken = accessToken
42-
}
39+
this.accessToken = opts.accessToken
4340
}
4441

4542
get accessToken() {

0 commit comments

Comments
 (0)