Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"flow": "flow",
"test": "yarn test-only",
"test-only": "jest --coverage --colors",
"test:watch": "jest --colors --watch",
"precommit": "lint-staged"
"test:watch": "jest --colors --watch"
},
"engineStrict": true,
"engines": {
Expand Down Expand Up @@ -97,11 +96,6 @@
"ENV": "node"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint"
Expand Down
4 changes: 2 additions & 2 deletions src/api/ApiMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export default function ApiMethod(method: string, options: ApiMethodOptions = {}
!isAuthMethod(method) || "auth" in params || "access_token" in params || "username" in params,
"`auth` must be present for methods that require authentication."
);

const requestUrl: string = url.format({
protocol: apiProtocol,
host: locations[locationid] || apiServer,
host: params.hostname || apiServer,
pathname: method,
query: params,
});
Expand Down
4 changes: 2 additions & 2 deletions src/oauth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ function popup() {
}
}

function getTokenFromCode(code: string, client_id: string, app_secret: string) {
function getTokenFromCode(code: string, hostname: string, client_id: string, app_secret: string) {
return ApiMethod("oauth2_token", {
params: { client_id: client_id, client_secret: app_secret, code: code },
params: { client_id: client_id, client_secret: app_secret, code: code, hostname: hostname },
});
}

Expand Down