Skip to content

Commit fb95e9f

Browse files
Merge pull request #44 from kuzzleio/kuz-345-sdk-add-login-method
bug correction on login: transmit info into body in query
2 parents 8f69144 + 7d9efff commit fb95e9f

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

dist/kuzzle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Kuzzle.prototype.login = function (strategy, credentials, expiresIn, cb) {
674674
request.expiresIn = expiresIn;
675675
}
676676

677-
this.query({controller: 'auth', action: 'login'}, request, {}, function(error, response) {
677+
this.query({controller: 'auth', action: 'login'}, {body: request}, {}, function(error, response) {
678678
if (error === null) {
679679
self.jwtToken = response.jwt;
680680

dist/kuzzle.min.js

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

dist/kuzzle.min.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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ Kuzzle.prototype.login = function (strategy, credentials, expiresIn, cb) {
399399
request.expiresIn = expiresIn;
400400
}
401401

402-
this.query({controller: 'auth', action: 'login'}, request, {}, function(error, response) {
402+
this.query({controller: 'auth', action: 'login'}, {body: request}, {}, function(error, response) {
403403
if (error === null) {
404404
self.jwtToken = response.jwt;
405405

test/kuzzle/constructor.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,9 @@ describe('Kuzzle constructor', () => {
917917
should(kuzzle.offlineQueue.length).be.exactly(1);
918918
should(kuzzle.offlineQueue[0].query.action).be.exactly('login');
919919
should(kuzzle.offlineQueue[0].query.controller).be.exactly('auth');
920-
should(kuzzle.offlineQueue[0].query.username).be.exactly('foo');
921-
should(kuzzle.offlineQueue[0].query.password).be.exactly('bar');
922-
should(kuzzle.offlineQueue[0].query.expiresIn).be.exactly('1h');
920+
should(kuzzle.offlineQueue[0].query.body.username).be.exactly('foo');
921+
should(kuzzle.offlineQueue[0].query.body.password).be.exactly('bar');
922+
should(kuzzle.offlineQueue[0].query.body.expiresIn).be.exactly('1h');
923923
});
924924

925925
it('should forward token when logged in', function () {

0 commit comments

Comments
 (0)