@stackfactor/client-api 1.1.82 → 1.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/users.js +7 -9
- package/package.json +1 -1
package/lib/users.js
CHANGED
|
@@ -391,14 +391,13 @@ const login = (email, password, rememberMe) => {
|
|
|
391
391
|
|
|
392
392
|
/**
|
|
393
393
|
* Logout from the server. It returns a promise
|
|
394
|
-
* @param {String}
|
|
394
|
+
* @param {String} refreshToken Authorization token
|
|
395
395
|
*/
|
|
396
|
-
const logout = (
|
|
396
|
+
const logout = (refreshToken) => {
|
|
397
397
|
return new Promise(function (resolve, reject) {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
};
|
|
401
|
-
let request = client.post("api/v1/auth/logout", {}, options);
|
|
398
|
+
let request = client.post("api/v1/auth/logout", {
|
|
399
|
+
refreshToken,
|
|
400
|
+
});
|
|
402
401
|
request
|
|
403
402
|
.then((response) => {
|
|
404
403
|
resolve(response.data);
|
|
@@ -414,10 +413,9 @@ const logout = (token) => {
|
|
|
414
413
|
* a new token can be restablished using login
|
|
415
414
|
* @param {String} token User's auth token to be refreshed
|
|
416
415
|
*/
|
|
417
|
-
const refreshToken = (
|
|
416
|
+
const refreshToken = (refreshToken) => {
|
|
418
417
|
return new Promise(function (resolve, reject) {
|
|
419
|
-
let
|
|
420
|
-
let request = client.post("api/v1/auth/refreshToken", {}, options);
|
|
418
|
+
let request = client.post("api/v1/auth/refreshToken", { refreshToken });
|
|
421
419
|
request
|
|
422
420
|
.then((response) => {
|
|
423
421
|
resolve(response.data);
|