ggez-banking-sdk 0.4.33 → 0.5.2

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/dist/api/api.js CHANGED
@@ -39,7 +39,15 @@ class API {
39
39
  this.user = new UserProxy(proxyData);
40
40
  }
41
41
  async logout() {
42
- await this.cookiesHelper.clearCredentialCookies();
42
+ try {
43
+ const deviceId = await this.cookiesHelper.getDeviceId();
44
+ if (deviceId) {
45
+ await this.user.logoutDevice({ id: deviceId });
46
+ }
47
+ }
48
+ finally {
49
+ await this.cookiesHelper.clearCredentialCookies();
50
+ }
43
51
  }
44
52
  }
45
53
  export { API };
@@ -499,16 +499,16 @@ class CookiesHelper {
499
499
  }
500
500
  async clearCredentialCookies() {
501
501
  try {
502
+ this.cachedUSR = null;
503
+ this.cachedDEK = null;
504
+ this.cachedAccessToken = null;
505
+ this.cachedJWTToken = null;
502
506
  await Promise.all([
503
507
  this.remove("USR"),
504
508
  this.remove("DEK"),
505
509
  this.remove("access_token"),
506
510
  this.remove("jwt_token"),
507
511
  ]);
508
- this.cachedUSR = null;
509
- this.cachedDEK = null;
510
- this.cachedAccessToken = null;
511
- this.cachedJWTToken = null;
512
512
  }
513
513
  catch (error) {
514
514
  this.errorHandler(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.4.33",
3
+ "version": "0.5.2",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",