Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit 49df610

Browse files
author
Paul Korzhyk
authored
Merge pull request #31 from ArjunInventor/patch-1
Bug fix: header undefined before loging in
2 parents c185bb0 + eb7927c commit 49df610

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/clientStub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ var DgraphClientStub = (function () {
333333
this.maybeStartRefreshTimer(this.accessToken);
334334
};
335335
DgraphClientStub.prototype.setAlphaAuthToken = function (authToken) {
336+
this.options.headers === undefined && (this.options.headers = {});
336337
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
337338
};
338339
DgraphClientStub.prototype.setSlashApiKey = function (apiKey) {

src/clientStub.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ export class DgraphClientStub {
372372
}
373373

374374
public setAlphaAuthToken(authToken: string) {
375+
this.options.headers === undefined && (this.options.headers = {});
375376
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
376377
}
377378

0 commit comments

Comments
 (0)