Skip to content

Commit

Permalink
Merge pull request #35 from dgraph-io/apoorv/rel-v20.07.2
Browse files Browse the repository at this point in the history
Fix lint errors & bump version for release
  • Loading branch information
vardhanapoorv authored Nov 3, 2020
2 parents b79ad75 + 65fa9e3 commit 1b41935
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/clientStub.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,15 @@ export class DgraphClientStub {
this.maybeStartRefreshTimer(this.accessToken);
}
setAlphaAuthToken(authToken) {
this.options.headers === undefined && (this.options.headers = {});
if (this.options.headers === undefined) {
this.options.headers = {};
}
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
}
setSlashApiKey(apiKey) {
if (this.options.headers === undefined) {
this.options.headers = {};
}
this.options.headers[SLASH_API_KEY_HEADER] = apiKey;
}
cancelRefreshTimer() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dgraph-js-http",
"version": "21.03.0-rc1",
"version": "20.07.2",
"description": "A javascript HTTP client for Dgraph",
"license": "Apache-2.0",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions src/clientStub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,16 @@ export class DgraphClientStub {
}

public setAlphaAuthToken(authToken: string) {
this.options.headers === undefined && (this.options.headers = {});
if (this.options.headers === undefined) {
this.options.headers = {};
}
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
}

public setSlashApiKey(apiKey: string) {
this.options.headers === undefined && (this.options.headers = {});
if (this.options.headers === undefined) {
this.options.headers = {};
}
this.options.headers[SLASH_API_KEY_HEADER] = apiKey;
}

Expand Down

0 comments on commit 1b41935

Please sign in to comment.