passbolt-browser-extension 5.17.0 → 5.18.1

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.
Files changed (185) hide show
  1. package/.pre-commit-config.yaml +6 -2
  2. package/CHANGELOG.md +106 -1
  3. package/README.md +2 -2
  4. package/RELEASE_NOTES.md +3 -94
  5. package/build-safari-extension/Passbolt-Safari-Extension/Passbolt - password manager/ViewController.swift +5 -5
  6. package/build-safari-extension/Passbolt-Safari-Extension/Passbolt - password manager.xcodeproj/project.pbxproj +10 -10
  7. package/eslint.config.mjs +3 -35
  8. package/jest.config.json +1 -2
  9. package/package.json +45 -54
  10. package/src/all/_locales/locales.test.js +2 -0
  11. package/src/all/background_page/controller/InformMenuController/InformMenuController.test.js +45 -1
  12. package/src/all/background_page/controller/accountRecovery/accountRecoverySaveUserSettingController.js +1 -2
  13. package/src/all/background_page/controller/accountRecovery/accountRecoverySaveUserSettingController.test.js +10 -8
  14. package/src/all/background_page/controller/accountRecovery/accountRecoveryValidatePublicKeyController.test.js +1 -1
  15. package/src/all/background_page/controller/auth/authLocalLogoutController.js +3 -14
  16. package/src/all/background_page/controller/auth/authLocalLogoutController.test.js +3 -3
  17. package/src/all/background_page/controller/auth/authLoginController.js +2 -2
  18. package/src/all/background_page/controller/auth/authOfflineLogoutController.js +4 -12
  19. package/src/all/background_page/controller/auth/authOfflineLogoutController.test.js +3 -3
  20. package/src/all/background_page/controller/auth/{findAndUpdateActiveSessionLocalStorageController.js → findAndUpdateActiveSessionSessionStorageController.js} +6 -6
  21. package/src/all/background_page/controller/auth/{findAndUpdateActiveSessionLocalStorageController.test.js → findAndUpdateActiveSessionSessionStorageController.test.js} +30 -30
  22. package/src/all/background_page/controller/auth/getOrFindActiveSessionController.test.js +22 -20
  23. package/src/all/background_page/controller/auth/isMfaRequiredController.js +5 -4
  24. package/src/all/background_page/controller/auth/isMfaRequiredController.test.js +3 -3
  25. package/src/all/background_page/controller/crypto/getUserKeyInfoController.test.js +1 -1
  26. package/src/all/background_page/controller/crypto/getUserPrivateKeyController.test.js +1 -1
  27. package/src/all/background_page/controller/extension/onExtensionInstalledController.js +61 -30
  28. package/src/all/background_page/controller/extension/onExtensionInstalledController.test.js +131 -19
  29. package/src/all/background_page/controller/informCallToActionController/informCallToActionController.test.js +46 -0
  30. package/src/all/background_page/controller/resource/setResourcesExpiryDateController.test.js +1 -1
  31. package/src/all/background_page/controller/sessionTimestamps/getSessionTimestampsController.js +54 -0
  32. package/src/all/background_page/controller/sessionTimestamps/getSessionTimestampsController.test.js +91 -0
  33. package/src/all/background_page/controller/share/shareResourcesController.test.js +2 -2
  34. package/src/all/background_page/controller/sso/getQualifiedSsoLoginErrorController.test.js +1 -1
  35. package/src/all/background_page/controller/sso/hasSsoLoginErrorController.test.js +1 -1
  36. package/src/all/background_page/controller/subscription/createSubscriptionKeyController.js +3 -3
  37. package/src/all/background_page/controller/subscription/createSubscriptionKeyController.test.js +4 -4
  38. package/src/all/background_page/controller/subscription/deleteSubscriptionKeyController.js +3 -3
  39. package/src/all/background_page/controller/subscription/deleteSubscriptionKeyController.test.js +4 -4
  40. package/src/all/background_page/controller/theme/findThemesController.js +52 -0
  41. package/src/all/background_page/controller/theme/findThemesController.test.js +68 -0
  42. package/src/all/background_page/controller/theme/updateThemeController.js +55 -0
  43. package/src/all/background_page/controller/theme/updateThemeController.test.js +76 -0
  44. package/src/all/background_page/controller/user/getOrFindLoggedInUserController.test.js +2 -2
  45. package/src/all/background_page/event/appEvents.js +1 -26
  46. package/src/all/background_page/event/authEvents.js +2 -2
  47. package/src/all/background_page/event/configEvents.js +0 -12
  48. package/src/all/background_page/event/informMenuEvents.js +2 -2
  49. package/src/all/background_page/event/quickAccessEvents.js +12 -0
  50. package/src/all/background_page/event/themeEvents.js +9 -21
  51. package/src/all/background_page/model/auth/authModel.js +3 -3
  52. package/src/all/background_page/model/auth/authModel.test.js +2 -2
  53. package/src/all/background_page/model/entity/export/exportResourcesFileEntity.js +2 -0
  54. package/src/all/background_page/model/entity/export/exportResourcesFileEntity.test.js +1 -0
  55. package/src/all/background_page/model/entity/import/importResourcesFileEntity.test.data.js +5 -0
  56. package/src/all/background_page/model/entity/sso/ssoLoginUrlEntity.js +1 -1
  57. package/src/all/background_page/model/entity/theme/themeEntity.test.data.js +12 -0
  58. package/src/all/background_page/model/entity/theme/themesCollection.test.data.js +10 -1
  59. package/src/all/background_page/model/export/resources/csvRowComposer/abstractRowComposer.js +8 -0
  60. package/src/all/background_page/model/export/resources/csvRowComposer/csvNetwrixRowComposer.js +67 -0
  61. package/src/all/background_page/model/export/resources/csvRowComposer/csvNetwrixRowComposer.test.js +37 -0
  62. package/src/all/background_page/model/export/resources/resourcesCsvExporter.js +5 -2
  63. package/src/all/background_page/model/export/resources/resourcesCsvExporter.test.js +3 -1
  64. package/src/all/background_page/model/import/resources/csvRowParser/csvNetwrixRowParser.js +98 -0
  65. package/src/all/background_page/model/import/resources/csvRowParser/csvNetwrixRowParser.test.js +145 -0
  66. package/src/all/background_page/model/import/resources/resourcesCsvImportParser.js +2 -0
  67. package/src/all/background_page/model/import/resources/resourcesCsvImportParser.test.js +19 -1
  68. package/src/all/background_page/model/keyring.test.js +1 -1
  69. package/src/all/background_page/model/multiFactorAuthentication/multiFactorAuthenticationModel.test.js +1 -1
  70. package/src/all/background_page/model/user/userModel.test.js +1 -1
  71. package/src/all/background_page/model/user.js +2 -2
  72. package/src/all/background_page/model/userSettings/userSettings.js +1 -1
  73. package/src/all/background_page/pagemod/appBootstrapPagemod.js +6 -5
  74. package/src/all/background_page/pagemod/appBootstrapPagemod.test.js +7 -12
  75. package/src/all/background_page/pagemod/authBootstrapPagemod.js +2 -2
  76. package/src/all/background_page/pagemod/authBootstrapPagemod.test.js +6 -7
  77. package/src/all/background_page/pagemod/pagemodManager.test.js +14 -20
  78. package/src/all/background_page/pagemod/webIntegrationPagemod.js +2 -2
  79. package/src/all/background_page/pagemod/webIntegrationPagemod.test.js +9 -9
  80. package/src/all/background_page/service/accountRecovery/decryptPrivateKeyPasswordDataService.js +1 -1
  81. package/src/all/background_page/service/accountRecovery/decryptResponseDataService.js +1 -1
  82. package/src/all/background_page/service/accountRecovery/parseAccountRecoveryUrlService.js +1 -1
  83. package/src/all/background_page/service/accountRecovery/validateOrganizationPublicKeyService.test.js +1 -1
  84. package/src/all/background_page/service/activeSession/{findAndUpdateActiveSessionLocalStorageService.js → findAndUpdateActiveSessionSessionStorageService.js} +27 -60
  85. package/src/all/background_page/service/activeSession/findAndUpdateActiveSessionSessionStorageService.test.js +720 -0
  86. package/src/all/background_page/service/activeSession/getOrFindActiveSessionService.js +8 -8
  87. package/src/all/background_page/service/activeSession/getOrFindActiveSessionService.test.js +16 -16
  88. package/src/all/background_page/service/api/accountSettings/accountSettingsService.js +0 -29
  89. package/src/all/background_page/service/api/accountSettings/accountSettingsService.test.data.js +0 -6
  90. package/src/all/background_page/service/api/accountSettings/accountSettingsService.test.js +1 -32
  91. package/src/all/background_page/service/api/actionLog/actionLogApiService.test.js +1 -1
  92. package/src/all/background_page/service/api/comment/commentApiService.test.js +1 -1
  93. package/src/all/background_page/service/api/metadata/metadataKeysApiService.test.js +1 -1
  94. package/src/all/background_page/service/api/sessionKey/sessionKeysBundlesApiService.test.js +1 -1
  95. package/src/all/background_page/service/api/theme/themesApiService.js +57 -0
  96. package/src/all/background_page/service/api/theme/themesApiService.test.js +83 -0
  97. package/src/all/background_page/service/app/parseAppUrlService.js +18 -10
  98. package/src/all/background_page/service/app/parseAppUrlService.test.js +21 -21
  99. package/src/all/background_page/service/auth/localLogoutService.js +42 -0
  100. package/src/all/background_page/service/auth/localLogoutService.test.js +43 -0
  101. package/src/all/background_page/service/auth/offlineLogoutService.js +47 -0
  102. package/src/all/background_page/service/auth/offlineLogoutService.test.js +46 -0
  103. package/src/all/background_page/service/auth/offlineSessionExpiryAlarmService.js +2 -2
  104. package/src/all/background_page/service/auth/offlineSessionExpiryAlarmService.test.js +3 -3
  105. package/src/all/background_page/service/auth/parseAuthUrlService.js +11 -6
  106. package/src/all/background_page/service/auth/parseAuthUrlService.test.js +11 -13
  107. package/src/all/background_page/service/auth/postLoginOfflineService.js +3 -3
  108. package/src/all/background_page/service/auth/postLoginOfflineService.test.js +3 -3
  109. package/src/all/background_page/service/auth/postLoginService.js +3 -3
  110. package/src/all/background_page/service/auth/postLoginService.test.js +3 -3
  111. package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.js +8 -4
  112. package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.test.js +36 -13
  113. package/src/all/background_page/service/authenticationStatusService.test.js +1 -1
  114. package/src/all/background_page/service/clipboard/clipboardProviderService.js +0 -7
  115. package/src/all/background_page/service/clipboard/clipboardProviderService.test.js +0 -10
  116. package/src/all/background_page/service/clipboard/copyToClipboardService.js +1 -5
  117. package/src/all/background_page/service/crypto/decryptSsoPassphraseService.js +1 -1
  118. package/src/all/background_page/service/extension/onStartUpService.js +2 -2
  119. package/src/all/background_page/service/extension/onStartUpService.test.js +3 -3
  120. package/src/all/background_page/service/localStorage/localStorageService.js +4 -2
  121. package/src/all/background_page/service/localStorage/localStorageService.test.js +28 -12
  122. package/src/all/background_page/service/local_storage/sessionTimestampsLocalStorage.js +40 -0
  123. package/src/all/background_page/service/local_storage/sessionTimestampsLocalStorage.test.js +63 -0
  124. package/src/all/background_page/service/metadata/rotateMetadata/rotateMetadataKeyService.test.js +2 -2
  125. package/src/all/background_page/service/metadata/rotateMetadata/rotateResourcesMetadataKeyService.test.js +2 -2
  126. package/src/all/background_page/service/migrateMetadata/migrateMetadataResourcesService.test.js +2 -2
  127. package/src/all/background_page/service/offline/canUseOfflineStorageService.js +16 -1
  128. package/src/all/background_page/service/offline/canUseOfflineStorageService.test.js +14 -6
  129. package/src/all/background_page/service/offline/getOrFindOfflineSettingsService.js +4 -1
  130. package/src/all/background_page/service/offline/getOrFindOfflineSettingsService.test.js +10 -1
  131. package/src/all/background_page/service/offline/offlineRetentionDataFlushService.js +12 -9
  132. package/src/all/background_page/service/offline/offlineRetentionDataFlushService.test.js +35 -24
  133. package/src/all/background_page/service/rbac/getOrFindRbacService.js +4 -1
  134. package/src/all/background_page/service/recover/parseRecoverUrlService.js +1 -1
  135. package/src/all/background_page/service/resource/export/exportResourcesService.test.js +3 -0
  136. package/src/all/background_page/service/resource/getOrFindOfflineResourcesService.js +30 -10
  137. package/src/all/background_page/service/resource/getOrFindOfflineResourcesService.test.js +108 -9
  138. package/src/all/background_page/service/resource/getOrFindResourcesService.js +30 -10
  139. package/src/all/background_page/service/resource/getOrFindResourcesService.test.js +99 -9
  140. package/src/all/background_page/service/resourceType/getOrFindResourceTypesService.js +4 -1
  141. package/src/all/background_page/service/resourceType/getOrFindResourceTypesService.test.js +10 -2
  142. package/src/all/background_page/service/secret/decryptAndParseResourceSecretService.js +1 -1
  143. package/src/all/background_page/service/sessionTimestamps/getSessionTimestampsService.js +48 -0
  144. package/src/all/background_page/service/sessionTimestamps/getSessionTimestampsService.test.js +66 -0
  145. package/src/all/background_page/service/sessionTimestamps/updateSessionTimestampsService.js +102 -0
  146. package/src/all/background_page/service/sessionTimestamps/updateSessionTimestampsService.test.js +221 -0
  147. package/src/all/background_page/service/{local_storage/activeSessionLocalStorage.js → session_storage/activeSessionSessionStorage.js} +17 -17
  148. package/src/all/background_page/service/{local_storage/activeSessionLocalStorage.test.js → session_storage/activeSessionSessionStorage.test.js} +31 -34
  149. package/src/all/background_page/service/setup/parseSetupUrlService.js +3 -2
  150. package/src/all/background_page/service/setup/parseSetupUrlService.test.js +195 -24
  151. package/src/all/background_page/service/share/shareFoldersService.test.js +4 -4
  152. package/src/all/background_page/service/share/shareResourceService.test.js +4 -4
  153. package/src/all/background_page/service/theme/findThemesService.js +38 -0
  154. package/src/all/background_page/service/theme/findThemesService.test.js +63 -0
  155. package/src/all/background_page/service/theme/updateThemeService.js +39 -0
  156. package/src/all/background_page/service/theme/updateThemeService.test.js +65 -0
  157. package/src/all/background_page/service/toolbar/toolbarService.js +20 -10
  158. package/src/all/background_page/service/toolbar/toolbarService.test.js +82 -6
  159. package/src/all/background_page/service/user/getOrFindMeService.js +4 -1
  160. package/src/all/background_page/service/user/getOrFindMeService.test.js +10 -2
  161. package/src/all/background_page/service/webIntegration/parseWebIntegrationUrlService.js +11 -6
  162. package/src/all/background_page/service/webIntegration/parseWebIntegrationUrlService.test.js +7 -9
  163. package/src/all/background_page/utils/format/formDataUtils.test.js +1 -1
  164. package/src/all/background_page/utils/openpgp/openpgpAssertions.js +1 -1
  165. package/src/all/webAccessibleResources/js/themes/stylesheet.js +1 -1
  166. package/src/chrome-mv3/manifest.json +1 -1
  167. package/src/chrome-mv3/serviceWorker/service/network/requestFetchOffscreenService.js +1 -1
  168. package/src/chrome-mv3/serviceWorker/service/network/responseFetchOffscreenService.js +7 -4
  169. package/src/firefox/manifest.json +1 -1
  170. package/src/safari/manifest.json +1 -1
  171. package/test/matchers/toBeOpenpgpKeySignedBy.js +13 -14
  172. package/test/mocks/mockJsDomPolyfill.js +0 -2
  173. package/webpack/common-blocks.js +13 -13
  174. package/webpack/expectedBuildArtifacts.js +1 -1
  175. package/webpack/passboltEnvPlugin.js +1 -1
  176. package/webpack.common.config.js +2 -0
  177. package/webpack.config.js +4 -5
  178. package/webpack.safari-background-page.config.js +38 -31
  179. package/src/all/background_page/model/theme/themeModel.js +0 -66
  180. package/src/all/background_page/model/theme/themeModel.test.js +0 -73
  181. package/src/all/background_page/service/activeSession/findAndUpdateActiveSessionLocalStorageService.test.js +0 -776
  182. package/src/chrome/manifest.json +0 -51
  183. package/src/chrome/polyfill/clipboard/edgeBackgroundPageClipboardService.js +0 -31
  184. package/src/chrome/polyfill/clipboard/edgeBackgroundPageClipboardService.test.js +0 -53
  185. package/webpack.chromium-mv2.config.js +0 -40
@@ -11,9 +11,9 @@
11
11
  * @link https://www.passbolt.com Passbolt(tm)
12
12
  * @since 6.0.0
13
13
  */
14
- import ActiveSessionLocalStorage from "../local_storage/activeSessionLocalStorage";
14
+ import ActiveSessionSessionStorage from "../session_storage/activeSessionSessionStorage";
15
15
  import UserActiveSessionEntity from "passbolt-styleguide/src/shared/models/entity/session/userActiveSessionEntity";
16
- import FindAndUpdateActiveSessionLocalStorageService from "./findAndUpdateActiveSessionLocalStorageService";
16
+ import FindAndUpdateActiveSessionSessionStorageService from "./findAndUpdateActiveSessionSessionStorageService";
17
17
 
18
18
  /**
19
19
  * The service aims to find a user active session.
@@ -26,8 +26,8 @@ export default class GetOrFindActiveSessionService {
26
26
  */
27
27
  constructor(account, apiClientOptions) {
28
28
  this.account = account;
29
- this.activeSessionLocalStorage = new ActiveSessionLocalStorage(account);
30
- this.findAndUpdateActiveSessionLocalStorageService = new FindAndUpdateActiveSessionLocalStorageService(
29
+ this.activeSessionSessionStorage = new ActiveSessionSessionStorage(account);
30
+ this.findAndUpdateActiveSessionSessionStorageService = new FindAndUpdateActiveSessionSessionStorageService(
31
31
  account,
32
32
  apiClientOptions,
33
33
  );
@@ -39,8 +39,8 @@ export default class GetOrFindActiveSessionService {
39
39
  * @returns {Promise<UserActiveSessionEntity>}
40
40
  */
41
41
  async getOrFind() {
42
- const hasRuntimeCache = this.activeSessionLocalStorage.hasCachedData();
43
- const userActiveSessionDto = await this.activeSessionLocalStorage.get();
42
+ const hasRuntimeCache = this.activeSessionSessionStorage.hasCachedData();
43
+ const userActiveSessionDto = await this.activeSessionSessionStorage.get();
44
44
  // Return local storage data if the storage was initialized.
45
45
  if (userActiveSessionDto) {
46
46
  try {
@@ -49,11 +49,11 @@ export default class GetOrFindActiveSessionService {
49
49
  } catch (error) {
50
50
  console.error(error);
51
51
  // If any validation error, retrieve or create a default user active session and update the local storage.
52
- return await this.findAndUpdateActiveSessionLocalStorageService.findAndUpdateAuthenticationStatus();
52
+ return await this.findAndUpdateActiveSessionSessionStorageService.findAndUpdateAuthenticationStatus();
53
53
  }
54
54
  }
55
55
 
56
56
  // Otherwise retrieve the user active session and update the local storage.
57
- return await this.findAndUpdateActiveSessionLocalStorageService.findAndUpdateAuthenticationStatus();
57
+ return await this.findAndUpdateActiveSessionSessionStorageService.findAndUpdateAuthenticationStatus();
58
58
  }
59
59
  }
@@ -15,12 +15,12 @@ import AccountEntity from "../../model/entity/account/accountEntity";
15
15
  import { defaultAccountDto } from "../../model/entity/account/accountEntity.test.data";
16
16
  import { defaultApiClientOptions } from "passbolt-styleguide/src/shared/lib/apiClient/apiClientOptions.test.data";
17
17
  import GetOrFindActiveSessionService from "./getOrFindActiveSessionService";
18
- import FindAndUpdateActiveSessionLocalStorageService from "./findAndUpdateActiveSessionLocalStorageService";
18
+ import FindAndUpdateActiveSessionSessionStorageService from "./findAndUpdateActiveSessionSessionStorageService";
19
19
  import FindServerStatusService from "../status/findServerStatusService";
20
20
  import UserActiveSessionEntity, {
21
21
  USER_ACTIVE_SESSION_ONLINE,
22
22
  } from "passbolt-styleguide/src/shared/models/entity/session/userActiveSessionEntity";
23
- import ActiveSessionLocalStorage from "../local_storage/activeSessionLocalStorage";
23
+ import ActiveSessionSessionStorage from "../session_storage/activeSessionSessionStorage";
24
24
 
25
25
  describe("GetOrFindActiveSessionService", () => {
26
26
  let service, account;
@@ -30,37 +30,37 @@ describe("GetOrFindActiveSessionService", () => {
30
30
  account = new AccountEntity(defaultAccountDto());
31
31
  service = new GetOrFindActiveSessionService(account, defaultApiClientOptions());
32
32
  // flush account related storage before each.
33
- await service.activeSessionLocalStorage.flush();
33
+ await service.activeSessionSessionStorage.flush();
34
34
  });
35
35
 
36
36
  describe("::getOrFindAll", () => {
37
37
  it("fetches from the API the server status and initializes the local storage with a user active session.", async () => {
38
38
  expect.assertions(3);
39
39
  jest.spyOn(FindServerStatusService.prototype, "find").mockImplementation(() => true);
40
- jest.spyOn(FindAndUpdateActiveSessionLocalStorageService.prototype, "findAndUpdateAuthenticationStatus");
40
+ jest.spyOn(FindAndUpdateActiveSessionSessionStorageService.prototype, "findAndUpdateAuthenticationStatus");
41
41
 
42
42
  const userActiveSessionEntity = await service.getOrFind();
43
43
 
44
44
  expect(
45
- FindAndUpdateActiveSessionLocalStorageService.prototype.findAndUpdateAuthenticationStatus,
45
+ FindAndUpdateActiveSessionSessionStorageService.prototype.findAndUpdateAuthenticationStatus,
46
46
  ).toHaveBeenCalledTimes(1);
47
47
  expect(userActiveSessionEntity).toBeInstanceOf(UserActiveSessionEntity);
48
- expect(await service.activeSessionLocalStorage.get()).toEqual(userActiveSessionEntity.toDto());
48
+ expect(await service.activeSessionSessionStorage.get()).toEqual(userActiveSessionEntity.toDto());
49
49
  });
50
50
 
51
51
  it("If any validation error happen, fetches from the API the server status and set the local storage with a user active session.", async () => {
52
52
  expect.assertions(3);
53
53
  jest.spyOn(FindServerStatusService.prototype, "find").mockImplementation(() => true);
54
- jest.spyOn(service.activeSessionLocalStorage, "get").mockImplementationOnce(() => {});
55
- jest.spyOn(FindAndUpdateActiveSessionLocalStorageService.prototype, "findAndUpdateAuthenticationStatus");
54
+ jest.spyOn(service.activeSessionSessionStorage, "get").mockImplementationOnce(() => {});
55
+ jest.spyOn(FindAndUpdateActiveSessionSessionStorageService.prototype, "findAndUpdateAuthenticationStatus");
56
56
 
57
57
  const userActiveSessionEntity = await service.getOrFind();
58
58
 
59
59
  expect(
60
- FindAndUpdateActiveSessionLocalStorageService.prototype.findAndUpdateAuthenticationStatus,
60
+ FindAndUpdateActiveSessionSessionStorageService.prototype.findAndUpdateAuthenticationStatus,
61
61
  ).toHaveBeenCalledTimes(1);
62
62
  expect(userActiveSessionEntity).toBeInstanceOf(UserActiveSessionEntity);
63
- expect(await service.activeSessionLocalStorage.get()).toEqual(userActiveSessionEntity.toDto());
63
+ expect(await service.activeSessionSessionStorage.get()).toEqual(userActiveSessionEntity.toDto());
64
64
  });
65
65
 
66
66
  it("retrieves user active session from the local storage when the local storage is initialized.", async () => {
@@ -71,15 +71,15 @@ describe("GetOrFindActiveSessionService", () => {
71
71
  type: USER_ACTIVE_SESSION_ONLINE,
72
72
  };
73
73
  jest.spyOn(FindServerStatusService.prototype, "find");
74
- await service.activeSessionLocalStorage.set(new UserActiveSessionEntity(userActiveSession));
74
+ await service.activeSessionSessionStorage.set(new UserActiveSessionEntity(userActiveSession));
75
75
 
76
- expect(service.activeSessionLocalStorage.hasCachedData()).toBeTruthy();
76
+ expect(service.activeSessionSessionStorage.hasCachedData()).toBeTruthy();
77
77
 
78
78
  const userActiveSessionEntity = await service.getOrFind();
79
79
 
80
80
  expect(FindServerStatusService.prototype.find).not.toHaveBeenCalled();
81
81
  expect(userActiveSessionEntity.toDto()).toEqual(userActiveSession);
82
- expect(await service.activeSessionLocalStorage.get()).toEqual(userActiveSessionEntity.toDto());
82
+ expect(await service.activeSessionSessionStorage.get()).toEqual(userActiveSessionEntity.toDto());
83
83
  });
84
84
 
85
85
  it("does not validate the user active session if the information is retrieved from the runtime cache.", async () => {
@@ -90,7 +90,7 @@ describe("GetOrFindActiveSessionService", () => {
90
90
  type: USER_ACTIVE_SESSION_ONLINE,
91
91
  };
92
92
  jest.spyOn(FindServerStatusService.prototype, "find");
93
- await service.activeSessionLocalStorage.set(new UserActiveSessionEntity(userActiveSession));
93
+ await service.activeSessionSessionStorage.set(new UserActiveSessionEntity(userActiveSession));
94
94
  jest.spyOn(UserActiveSessionEntity.prototype, "validateSchema");
95
95
 
96
96
  await service.getOrFind();
@@ -108,8 +108,8 @@ describe("GetOrFindActiveSessionService", () => {
108
108
  type: USER_ACTIVE_SESSION_ONLINE,
109
109
  };
110
110
  jest.spyOn(FindServerStatusService.prototype, "find");
111
- await service.activeSessionLocalStorage.set(new UserActiveSessionEntity(userActiveSession));
112
- ActiveSessionLocalStorage._runtimeCachedData = {};
111
+ await service.activeSessionSessionStorage.set(new UserActiveSessionEntity(userActiveSession));
112
+ ActiveSessionSessionStorage._runtimeCachedData = {};
113
113
  jest.spyOn(UserActiveSessionEntity.prototype, "validateSchema");
114
114
 
115
115
  await service.getOrFind();
@@ -35,35 +35,6 @@ class AccountSettingsService extends AbstractService {
35
35
  return RESOURCE_SERVICE_RESOURCE_NAME;
36
36
  }
37
37
 
38
- /**
39
- * Find all themes
40
- *
41
- * @returns {Promise<*>} response body
42
- * @throws {Error} if options are invalid or API error
43
- * @public
44
- */
45
- async findAllThemes() {
46
- const url = this.apiClient.buildUrl(`${this.apiClient.baseUrl}/themes`);
47
- const response = await this.apiClient.fetchAndHandleResponse("GET", url);
48
- return response.body;
49
- }
50
-
51
- /**
52
- * Update the current user theme
53
- *
54
- * @param {string} name The theme name to switch on
55
- * @returns {Promise<*>} response body
56
- * @throws {Error} if options are invalid or API error
57
- * @public
58
- */
59
- async updateTheme(name) {
60
- const data = { value: name };
61
- const bodyString = this.apiClient.buildBody(data);
62
- const url = this.apiClient.buildUrl(`${this.apiClient.baseUrl}/themes`);
63
- const response = await this.apiClient.fetchAndHandleResponse("POST", url, bodyString);
64
- return response.body;
65
- }
66
-
67
38
  /**
68
39
  * Update the current user locale language
69
40
  *
@@ -21,12 +21,6 @@ export const accountSettingsService_midgarThemeDto = (data = {}) => ({
21
21
  ...data,
22
22
  });
23
23
 
24
- export const accountSettingsService_themesDto = () => [
25
- accountSettingsService_midgarThemeDto({ value: "default" }),
26
- accountSettingsService_midgarThemeDto({ value: "midgar" }),
27
- accountSettingsService_midgarThemeDto({ value: "solarized_light" }),
28
- ];
29
-
30
24
  export const accountSettingsService_localeDto = (data = {}) => ({
31
25
  id: uuidv4(),
32
26
  value: "en-UK",
@@ -16,11 +16,7 @@ import { defaultApiClientOptions } from "passbolt-styleguide/src/shared/lib/apiC
16
16
  import AccountSettingsService from "./accountSettingsService";
17
17
  import { enableFetchMocks } from "jest-fetch-mock";
18
18
  import { mockApiResponse } from "../../../../../../test/mocks/mockApiResponse";
19
- import {
20
- accountSettingsService_midgarThemeDto,
21
- accountSettingsService_themesDto,
22
- accountSettingsService_localeDto,
23
- } from "./accountSettingsService.test.data";
19
+ import { accountSettingsService_localeDto } from "./accountSettingsService.test.data";
24
20
 
25
21
  describe("accountSettingsService", () => {
26
22
  let service;
@@ -31,33 +27,6 @@ describe("accountSettingsService", () => {
31
27
  service = new AccountSettingsService(apiClientOptions);
32
28
  });
33
29
 
34
- describe("::updateTheme", () => {
35
- it("should update the theme value to $expectedUpdateThemeName", async () => {
36
- expect.assertions(1);
37
-
38
- const expectedUpdateThemeName = "midgar";
39
- fetch.doMockOnceIf(
40
- new RegExp("/settings/themes"),
41
- async () => await mockApiResponse(accountSettingsService_midgarThemeDto()),
42
- );
43
- const receivedUpdateThemeName = await service.updateTheme(expectedUpdateThemeName);
44
-
45
- expect(receivedUpdateThemeName.value).toBe(expectedUpdateThemeName);
46
- });
47
- });
48
-
49
- describe("::findAllThemes", () => {
50
- it("should return all available themes", async () => {
51
- expect.assertions(1);
52
-
53
- const expectedThemes = accountSettingsService_themesDto();
54
- fetch.doMockOnceIf(new RegExp("/settings/themes"), async () => await mockApiResponse(expectedThemes));
55
- const result = await service.findAllThemes();
56
-
57
- expect(result).toEqual(expectedThemes);
58
- });
59
- });
60
-
61
30
  describe("::updateLocale", () => {
62
31
  it("should update the locale value", async () => {
63
32
  expect.assertions(1);
@@ -40,7 +40,7 @@ describe("ActionLogService", () => {
40
40
  const service = new ActionLogApiService(apiClientOptions, account);
41
41
  const result = await service.findAllFor("Resource", uuidv4(), 1, 5);
42
42
 
43
- expect(result).toBeInstanceOf(Array);
43
+ expect(Array.isArray(result)).toBe(true);
44
44
  expect(result).toHaveLength(apiResponse.length);
45
45
  });
46
46
 
@@ -43,7 +43,7 @@ describe("ActionLogService", () => {
43
43
  const service = new CommentApiService(apiClientOptions, account);
44
44
  const resultDto = await service.findAll("Resource", uuidv4(), { creator: true });
45
45
 
46
- expect(resultDto).toBeInstanceOf(Array);
46
+ expect(Array.isArray(resultDto)).toBe(true);
47
47
  expect(resultDto).toHaveLength(commentsCollection.length);
48
48
  });
49
49
 
@@ -47,7 +47,7 @@ describe("MetadataKeysApiService", () => {
47
47
  const service = new MetadataKeysApiService(apiClientOptions, account);
48
48
  const resultDto = await service.findAll();
49
49
 
50
- expect(resultDto).toBeInstanceOf(Array);
50
+ expect(Array.isArray(resultDto)).toBe(true);
51
51
  expect(resultDto).toHaveLength(apiMetadataKeysCollection.length);
52
52
  });
53
53
 
@@ -48,7 +48,7 @@ describe("SessionKeysBundlesApiService", () => {
48
48
  const service = new SessionKeysBundlesApiService(apiClientOptions);
49
49
  const resultDto = await service.findAll();
50
50
 
51
- expect(resultDto).toBeInstanceOf(Array);
51
+ expect(Array.isArray(resultDto)).toBe(true);
52
52
  expect(resultDto).toHaveLength(apiSessionKeysBundlesCollection.length);
53
53
  });
54
54
 
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 5.18.0
13
+ */
14
+ import AbstractService from "passbolt-styleguide/src/shared/services/api/abstract/abstractService";
15
+ import ChangeThemeEntity from "../../../model/entity/theme/change/ChangeThemeEntity";
16
+ import { assertType } from "../../../utils/assertions";
17
+
18
+ const THEMES_RESOURCE_NAME = "account/settings/themes";
19
+
20
+ export default class ThemesApiService extends AbstractService {
21
+ /**
22
+ * Constructor
23
+ * @param {ApiClientOptions} apiClientOptions
24
+ */
25
+ constructor(apiClientOptions) {
26
+ super(apiClientOptions, ThemesApiService.RESOURCE_NAME);
27
+ }
28
+
29
+ /**
30
+ * API themes resource name
31
+ * @returns {string}
32
+ */
33
+ static get RESOURCE_NAME() {
34
+ return THEMES_RESOURCE_NAME;
35
+ }
36
+
37
+ /**
38
+ * Find all the themes.
39
+ * @returns {Promise<Array<object>>} the themes dtos
40
+ */
41
+ async findAll() {
42
+ const response = await this.apiClient.findAll();
43
+ return response.body;
44
+ }
45
+
46
+ /**
47
+ * Update the current user theme.
48
+ * @param {ChangeThemeEntity} changeThemeEntity the theme to apply
49
+ * @returns {Promise<object>} the account setting dto
50
+ * @throws {TypeError} if changeThemeEntity is not a ChangeThemeEntity
51
+ */
52
+ async update(changeThemeEntity) {
53
+ assertType(changeThemeEntity, ChangeThemeEntity, "The given parameter is not a valid ChangeThemeEntity");
54
+ const response = await this.apiClient.create({ value: changeThemeEntity.name });
55
+ return response.body;
56
+ }
57
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 5.18.0
13
+ */
14
+ import { enableFetchMocks } from "jest-fetch-mock";
15
+ import { mockApiResponse, mockApiResponseError } from "../../../../../../test/mocks/mockApiResponse";
16
+ import { defaultApiClientOptions } from "passbolt-styleguide/src/shared/lib/apiClient/apiClientOptions.test.data";
17
+ import PassboltApiFetchError from "passbolt-styleguide/src/shared/lib/Error/PassboltApiFetchError";
18
+ import ThemesApiService from "./themesApiService";
19
+ import ChangeThemeEntity from "../../../model/entity/theme/change/ChangeThemeEntity";
20
+ import { defaultThemeCollectionDtos } from "../../../model/entity/theme/themesCollection.test.data";
21
+ import { accountSettingsService_midgarThemeDto } from "../accountSettings/accountSettingsService.test.data";
22
+
23
+ beforeEach(() => {
24
+ enableFetchMocks();
25
+ jest.clearAllMocks();
26
+ });
27
+
28
+ describe("ThemesApiService", () => {
29
+ let service;
30
+
31
+ beforeEach(() => {
32
+ service = new ThemesApiService(defaultApiClientOptions());
33
+ });
34
+
35
+ it("has the correct resource name", () => {
36
+ expect.assertions(1);
37
+ expect(ThemesApiService.RESOURCE_NAME).toEqual("account/settings/themes");
38
+ });
39
+
40
+ describe("ThemesApiService::findAll", () => {
41
+ it("gets the themes and returns the body", async () => {
42
+ expect.assertions(2);
43
+ const dtos = defaultThemeCollectionDtos();
44
+ fetch.doMockOnceIf(/account\/settings\/themes\.json/, async (req) => {
45
+ expect(req.method).toEqual("GET");
46
+ return mockApiResponse(dtos);
47
+ });
48
+ const body = await service.findAll();
49
+ expect(body).toEqual(dtos);
50
+ });
51
+
52
+ it("throws on API error", async () => {
53
+ expect.assertions(1);
54
+ fetch.doMockOnceIf(/account\/settings\/themes\.json/, () => mockApiResponseError(500, "Something went wrong"));
55
+ await expect(service.findAll()).rejects.toThrow(PassboltApiFetchError);
56
+ });
57
+ });
58
+
59
+ describe("ThemesApiService::update", () => {
60
+ it("posts the theme name and returns the body", async () => {
61
+ expect.assertions(3);
62
+ const dto = accountSettingsService_midgarThemeDto();
63
+ fetch.doMockOnceIf(/account\/settings\/themes\.json/, async (req) => {
64
+ expect(req.method).toEqual("POST");
65
+ expect(await req.json()).toEqual({ value: "midgar" });
66
+ return mockApiResponse(dto);
67
+ });
68
+ const body = await service.update(new ChangeThemeEntity({ name: "midgar" }));
69
+ expect(body).toEqual(dto);
70
+ });
71
+
72
+ it("throws if the parameter is not a ChangeThemeEntity", async () => {
73
+ expect.assertions(1);
74
+ await expect(service.update({ name: "midgar" })).rejects.toThrow(TypeError);
75
+ });
76
+
77
+ it("throws on API error", async () => {
78
+ expect.assertions(1);
79
+ fetch.doMockOnceIf(/account\/settings\/themes\.json/, () => mockApiResponseError(500, "Something went wrong"));
80
+ await expect(service.update(new ChangeThemeEntity({ name: "midgar" }))).rejects.toThrow(PassboltApiFetchError);
81
+ });
82
+ });
83
+ });
@@ -1,3 +1,6 @@
1
+ import { assertString, assertType } from "../../utils/assertions";
2
+ import AccountEntity from "../../model/entity/account/accountEntity";
3
+
1
4
  /**
2
5
  * Passbolt ~ Open source password manager for teams
3
6
  * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
@@ -11,27 +14,29 @@
11
14
  * @link https://www.passbolt.com Passbolt(tm)
12
15
  * @since 3.6.0
13
16
  */
14
- import User from "../../model/user";
15
-
16
17
  class ParseAppUrlService {
17
18
  /**
18
19
  * Get regex to check URI validity
20
+ * @param {AccountEntity} account The account
19
21
  * @returns {string}
20
22
  */
21
- static getRegex() {
22
- const user = User.getInstance();
23
- const escapedDomain = user.settings.getDomain().replace(/\W/g, "\\$&");
23
+ static getRegex(account) {
24
+ assertType(account, AccountEntity);
25
+ const escapedDomain = account.domain.replace(/\W/g, "\\$&");
24
26
  return `^${escapedDomain}/?(/app.*)?(#.*)?$`;
25
27
  }
26
28
 
27
29
  /**
28
30
  * Parse url to match .
31
+ * @param {AccountEntity} account The account
29
32
  * @param {string} url The url to parse.
30
33
  * @returns {{domain: string}}
31
34
  * @throw {Error} If the setup url cannot be parsed.
32
35
  */
33
- static parse(url) {
34
- const regex = new RegExp(this.getRegex());
36
+ static parse(account, url) {
37
+ assertType(account, AccountEntity);
38
+ assertString(url);
39
+ const regex = new RegExp(this.getRegex(account));
35
40
 
36
41
  if (!regex.test(url)) {
37
42
  throw new Error("Cannot parse application url. The url does not match the pattern.");
@@ -43,18 +48,21 @@ class ParseAppUrlService {
43
48
  new URL(url);
44
49
  } catch (error) {
45
50
  console.error(error);
46
- throw new Error("Cannot parse application url. The domain is not valid.");
51
+ throw new Error("Cannot parse application url. The domain is not valid.", { cause: error });
47
52
  }
48
53
  }
49
54
 
50
55
  /**
51
56
  * Test the url against the regex.
57
+ * @param {AccountEntity} account The account
52
58
  * @param {string} url The url to test
53
59
  * @returns {boolean}
54
60
  */
55
- static test(url) {
61
+ static test(account, url) {
56
62
  try {
57
- this.parse(url);
63
+ assertType(account, AccountEntity);
64
+ assertString(url);
65
+ this.parse(account, url);
58
66
  return true;
59
67
  } catch {
60
68
  return false;
@@ -12,29 +12,26 @@
12
12
  * @since 3.6.0
13
13
  */
14
14
 
15
- import { Config } from "../../model/config";
16
15
  import ParseAppUrlService from "./parseAppUrlService";
16
+ import AccountEntity from "../../model/entity/account/accountEntity";
17
+ import { defaultAccountDto } from "../../model/entity/account/accountEntity.test.data";
17
18
 
18
19
  const errorMatchPattern = "Cannot parse application url. The url does not match the pattern.";
19
20
  const errorDomainInvalid = "Cannot parse application url. The domain is not valid.";
20
21
 
21
- const domain = "https://passbolt.dev";
22
-
23
- beforeEach(() => {
24
- Config.write("user.settings.trustedDomain", "https://passbolt.dev");
25
- });
22
+ const domain = "https://passbolt.local";
26
23
 
27
24
  describe("ParseAppUrlService", () => {
28
25
  describe("ParseAppUrlService:parse", () => {
29
26
  describe.each([
30
27
  {
31
28
  scenario: "TLD",
32
- url: "https://passbolt.dev/app/folders/view/5452ecb2-0625-50d1-b1ef-d2038f5830b6",
29
+ url: "https://passbolt.local/app/folders/view/5452ecb2-0625-50d1-b1ef-d2038f5830b6",
33
30
  domain: domain,
34
31
  },
35
32
  {
36
33
  scenario: "TLD with Port",
37
- url: "https://passbolt.dev:4443/app/passwords",
34
+ url: "https://passbolt.local:4443/app/passwords",
38
35
  domain: `${domain}:4443`,
39
36
  },
40
37
  {
@@ -64,7 +61,7 @@ describe("ParseAppUrlService", () => {
64
61
  },
65
62
  {
66
63
  scenario: "Trailing /",
67
- url: "https://passbolt.dev/app/administration/account-recovery//",
64
+ url: "https://passbolt.local/app/administration/account-recovery//",
68
65
  domain: `${domain}/app/administration/account-recovery/`,
69
66
  },
70
67
  {
@@ -78,13 +75,14 @@ describe("ParseAppUrlService", () => {
78
75
  domain: `https://demo.passbolt.com`,
79
76
  },
80
77
  ])("should parse", (_props) => {
78
+ let account;
81
79
  beforeEach(() => {
82
- Config.write("user.settings.trustedDomain", _props.domain);
80
+ account = new AccountEntity(defaultAccountDto({ domain: _props.domain }));
83
81
  });
84
82
  it(`should parse: ${_props.scenario}`, () => {
85
83
  expect.assertions(2);
86
- expect(() => ParseAppUrlService.parse(_props.url)).not.toThrow(errorMatchPattern);
87
- expect(() => ParseAppUrlService.parse(_props.url)).not.toThrow(errorDomainInvalid);
84
+ expect(() => ParseAppUrlService.parse(account, _props.url)).not.toThrow(errorMatchPattern);
85
+ expect(() => ParseAppUrlService.parse(account, _props.url)).not.toThrow(errorDomainInvalid);
88
86
  });
89
87
  });
90
88
 
@@ -95,7 +93,7 @@ describe("ParseAppUrlService", () => {
95
93
  },
96
94
  {
97
95
  scenario: "Wrong protocol",
98
- url: "http://passbolt.dev",
96
+ url: "http://passbolt.local",
99
97
  },
100
98
  {
101
99
  scenario: "Not a domain allowed",
@@ -103,40 +101,42 @@ describe("ParseAppUrlService", () => {
103
101
  },
104
102
  {
105
103
  scenario: "Original domain as subdomain attack",
106
- url: "https://passbolt.dev.attacker.com",
104
+ url: "https://passbolt.local.attacker.com",
107
105
  },
108
106
  {
109
107
  scenario: "Subdomain attack",
110
- url: "https://attack.passbolt.dev",
108
+ url: "https://attack.passbolt.local",
111
109
  },
112
110
  {
113
111
  scenario: "Regex wild mark attack",
114
- url: "https://passboltxdev",
112
+ url: "https://passboltxlocal",
115
113
  },
116
114
  {
117
115
  scenario: "Non application entry point",
118
- url: "https://passbolt.dev/auth/login",
116
+ url: "https://passbolt.local/auth/login",
119
117
  },
120
118
  {
121
119
  scenario: "Domain look alike as hash attack",
122
120
  url: `https://www.attacker.com#${domain}`,
123
121
  },
124
122
  ])("should not parse", (_props) => {
123
+ const account = new AccountEntity(defaultAccountDto());
125
124
  it(`should not parse: ${_props.scenario}`, () => {
126
125
  expect.assertions(1);
127
- expect(() => ParseAppUrlService.parse(_props.url)).toThrow(errorMatchPattern);
126
+ expect(() => ParseAppUrlService.parse(account, _props.url)).toThrow(errorMatchPattern);
128
127
  });
129
128
  });
130
129
  });
131
130
  describe("ParseAppUrlService:getContext", () => {
132
131
  it(`should return regex based on trusted domain`, () => {
133
132
  expect.assertions(1);
134
- expect(ParseAppUrlService.getRegex()).toBe("^https\\:\\/\\/passbolt\\.dev/?(/app.*)?(#.*)?$");
133
+ const account = new AccountEntity(defaultAccountDto());
134
+ expect(ParseAppUrlService.getRegex(account)).toBe("^https\\:\\/\\/passbolt\\.local/?(/app.*)?(#.*)?$");
135
135
  });
136
136
  it(`should escaped characters from domain`, () => {
137
- Config.write("user.settings.trustedDomain", "https://passbolt.dev/#/");
137
+ const account = new AccountEntity(defaultAccountDto({ domain: "https://passbolt.local/#/" }));
138
138
  expect.assertions(1);
139
- expect(ParseAppUrlService.getRegex()).toBe("^https\\:\\/\\/passbolt\\.dev\\/\\#\\//?(/app.*)?(#.*)?$");
139
+ expect(ParseAppUrlService.getRegex(account)).toBe("^https\\:\\/\\/passbolt\\.local\\/\\#\\//?(/app.*)?(#.*)?$");
140
140
  });
141
141
  });
142
142
  });
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 5.18.0
13
+ */
14
+
15
+ import SessionCookieFlushService from "./sessionCookieFlushService";
16
+ import OfflineLogoutService from "./offlineLogoutService";
17
+
18
+ /**
19
+ * Sign out a user authenticated online when the API is unavailable. The API is not called.
20
+ */
21
+ class LocalLogoutService {
22
+ /**
23
+ * @constructor
24
+ * @param {AccountEntity} account The user account
25
+ * @param {ApiClientOptions} apiClientOptions The api client options
26
+ */
27
+ constructor(account, apiClientOptions) {
28
+ this.sessionCookieFlushService = new SessionCookieFlushService(account);
29
+ this.offlineLogoutService = new OfflineLogoutService(account, apiClientOptions);
30
+ }
31
+
32
+ /**
33
+ * Remove the session cookies, then sign the user out as an offline logout does.
34
+ * @return {Promise<void>}
35
+ */
36
+ async exec() {
37
+ await this.sessionCookieFlushService.flush();
38
+ await this.offlineLogoutService.exec();
39
+ }
40
+ }
41
+
42
+ export default LocalLogoutService;