@etsoo/appscript 1.5.30 → 1.5.31

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.
@@ -1549,13 +1549,19 @@ class CoreApp {
1549
1549
  * @param apiUrl Signout API URL
1550
1550
  */
1551
1551
  async signout() {
1552
- await this.api.put('User/Signout', { deviceId: this.deviceId }, {
1553
- onError: (error) => {
1554
- console.error('CoreApp.signout error', error);
1555
- // Prevent further processing
1556
- return false;
1557
- }
1558
- });
1552
+ const token = this.getCacheToken();
1553
+ if (token) {
1554
+ await this.api.put('Auth/Signout', {
1555
+ deviceId: this.deviceId,
1556
+ token: this.encrypt(token)
1557
+ }, {
1558
+ onError: (error) => {
1559
+ console.error('CoreApp.signout error', error);
1560
+ // Prevent further processing
1561
+ return false;
1562
+ }
1563
+ });
1564
+ }
1559
1565
  // Clear, noTrigger = true, avoid state update
1560
1566
  this.userLogout(true, true);
1561
1567
  // Go to login page
@@ -1546,13 +1546,19 @@ export class CoreApp {
1546
1546
  * @param apiUrl Signout API URL
1547
1547
  */
1548
1548
  async signout() {
1549
- await this.api.put('User/Signout', { deviceId: this.deviceId }, {
1550
- onError: (error) => {
1551
- console.error('CoreApp.signout error', error);
1552
- // Prevent further processing
1553
- return false;
1554
- }
1555
- });
1549
+ const token = this.getCacheToken();
1550
+ if (token) {
1551
+ await this.api.put('Auth/Signout', {
1552
+ deviceId: this.deviceId,
1553
+ token: this.encrypt(token)
1554
+ }, {
1555
+ onError: (error) => {
1556
+ console.error('CoreApp.signout error', error);
1557
+ // Prevent further processing
1558
+ return false;
1559
+ }
1560
+ });
1561
+ }
1556
1562
  // Clear, noTrigger = true, avoid state update
1557
1563
  this.userLogout(true, true);
1558
1564
  // Go to login page
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -2126,17 +2126,23 @@ export abstract class CoreApp<
2126
2126
  * @param apiUrl Signout API URL
2127
2127
  */
2128
2128
  async signout() {
2129
- await this.api.put<boolean>(
2130
- 'User/Signout',
2131
- { deviceId: this.deviceId },
2132
- {
2133
- onError: (error) => {
2134
- console.error('CoreApp.signout error', error);
2135
- // Prevent further processing
2136
- return false;
2129
+ const token = this.getCacheToken();
2130
+ if (token) {
2131
+ await this.api.put<boolean>(
2132
+ 'Auth/Signout',
2133
+ {
2134
+ deviceId: this.deviceId,
2135
+ token: this.encrypt(token)
2136
+ },
2137
+ {
2138
+ onError: (error) => {
2139
+ console.error('CoreApp.signout error', error);
2140
+ // Prevent further processing
2141
+ return false;
2142
+ }
2137
2143
  }
2138
- }
2139
- );
2144
+ );
2145
+ }
2140
2146
 
2141
2147
  // Clear, noTrigger = true, avoid state update
2142
2148
  this.userLogout(true, true);