Skip to content

Commit 869275e

Browse files
committed
Login credentials now optional
1 parent b9c3701 commit 869275e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kuzzle-sdk",
3-
"version": "1.7.2",
3+
"version": "1.7.3",
44
"description": "Official Javascript SDK for Kuzzle",
55
"author": "The Kuzzle Team <[email protected]>",
66
"repository": {

src/kuzzle.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ Kuzzle.prototype.login = function (strategy, credentials, expiresIn, cb) {
434434
strategy: strategy
435435
};
436436

437+
// don't need credentials in case of an OAUTH strategy
438+
if (typeof credentials === 'number' || typeof credentials === 'string') {
439+
cb = expiresIn;
440+
expiresIn = credentials;
441+
}
437442
if (!cb && typeof expiresIn === 'function') {
438443
cb = expiresIn;
439444
expiresIn = null;

0 commit comments

Comments
 (0)