Skip to content

Commit 975b010

Browse files
committed
change request jwt token format
1 parent 863a7f2 commit 975b010

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

dist/kuzzle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/kuzzle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/kuzzle.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,7 @@ Kuzzle.prototype.query = function (queryArgs, query, options, cb) {
12911291
* a developer simply wish to verify his token
12921292
*/
12931293
if (self.jwtToken !== undefined && !(object.controller === 'auth' && object.action === 'checkToken')) {
1294-
object.headers = object.headers || {};
1295-
object.headers.authorization = 'Bearer ' + self.jwtToken;
1294+
object.jwt = self.jwtToken;
12961295
}
12971296

12981297
if (queryArgs.collection) {

test/kuzzle/constructor.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ describe('Kuzzle constructor', () => {
10311031
should(kuzzle.offlineQueue[0].query.action).be.exactly('action');
10321032
should(kuzzle.offlineQueue[0].query.controller).be.exactly('controller');
10331033
should(kuzzle.offlineQueue[0].query.index).be.exactly('index');
1034-
should(kuzzle.offlineQueue[0].query.headers.authorization).be.exactly('Bearer fake-token');
1034+
should(kuzzle.offlineQueue[0].query.jwt).be.exactly('fake-token');
10351035
});
10361036
});
10371037
});

0 commit comments

Comments
 (0)