Skip to content

Commit ca283c3

Browse files
committed
Merge branch 'KUZ-378-whoami' of github.com:kuzzleio/sdk-javascript into KUZ-378-whoami
Conflicts: dist/kuzzle.min.js dist/kuzzle.min.map
2 parents e0e8a2a + cb015b1 commit ca283c3

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

dist/kuzzle.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,23 @@ Kuzzle.prototype.checkToken = function (token, callback) {
753753
return self;
754754
};
755755

756+
/**
757+
* Fetches the current user.
758+
*
759+
* @param {function} callback The callback to be called when the response is
760+
* available. The signature is `function(error, response)`.
761+
* @return {Kuzzle} The Kuzzle instance to enable chaining.
762+
*/
763+
Kuzzle.prototype.whoAmI = function (callback) {
764+
var self = this;
765+
766+
this.callbackRequired('Kuzzle.checkToken', callback);
767+
768+
this.query({controller: 'auth', action: 'getCurrentUser'}, {}, {}, callback);
769+
770+
return self;
771+
};
772+
756773
/**
757774
* Clean up the queue, ensuring the queryTTL and queryMaxSize properties are respected
758775
*/

0 commit comments

Comments
 (0)