@aws-amplify/auth 6.4.2 → 6.4.3-storage-browser.cf3aed2.0

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 (31) hide show
  1. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdStore.js +7 -1
  2. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdStore.js.map +1 -1
  3. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.d.ts +1 -1
  4. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.d.ts +1 -1
  5. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createChangePasswordClient.d.ts +1 -1
  6. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.d.ts +1 -1
  7. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.d.ts +1 -1
  8. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.d.ts +1 -1
  9. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteUserAttributesClient.d.ts +1 -1
  10. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteUserClient.d.ts +1 -1
  11. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgetDeviceClient.d.ts +1 -1
  12. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.d.ts +1 -1
  13. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.d.ts +1 -1
  14. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.d.ts +1 -1
  15. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.d.ts +1 -1
  16. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.d.ts +1 -1
  17. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListDevicesClient.d.ts +1 -1
  18. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.d.ts +1 -1
  19. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.d.ts +1 -1
  20. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.d.ts +1 -1
  21. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSetUserMFAPreferenceClient.d.ts +1 -1
  22. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.d.ts +1 -1
  23. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateDeviceStatusClient.d.ts +1 -1
  24. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateUserAttributesClient.d.ts +1 -1
  25. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.d.ts +1 -1
  26. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.d.ts +1 -1
  27. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.d.ts +1 -0
  28. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs +7 -1
  29. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs.map +1 -1
  30. package/package.json +104 -104
  31. package/src/providers/cognito/credentialsProvider/IdentityIdStore.ts +10 -1
@@ -17,6 +17,7 @@ class DefaultIdentityIdStore {
17
17
  }
18
18
  constructor(keyValueStorage) {
19
19
  this._authKeys = {};
20
+ this._hasGuestIdentityId = false;
20
21
  this.keyValueStorage = keyValueStorage;
21
22
  }
22
23
  async loadIdentityId() {
@@ -31,6 +32,7 @@ class DefaultIdentityIdStore {
31
32
  else {
32
33
  const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);
33
34
  if (storedIdentityId) {
35
+ this._hasGuestIdentityId = true;
34
36
  return {
35
37
  id: storedIdentityId,
36
38
  type: 'guest',
@@ -50,11 +52,15 @@ class DefaultIdentityIdStore {
50
52
  this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);
51
53
  // Clear in-memory storage of primary identityId
52
54
  this._primaryIdentityId = undefined;
55
+ this._hasGuestIdentityId = true;
53
56
  }
54
57
  else {
55
58
  this._primaryIdentityId = identity.id;
56
59
  // Clear locally stored guest id
57
- this.keyValueStorage.removeItem(this._authKeys.identityId);
60
+ if (this._hasGuestIdentityId) {
61
+ this.keyValueStorage.removeItem(this._authKeys.identityId);
62
+ this._hasGuestIdentityId = false;
63
+ }
58
64
  }
59
65
  }
60
66
  async clearIdentityId() {
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityIdStore.js","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultIdentityIdStore = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst TokenStore_1 = require(\"../tokenProvider/TokenStore\");\nconst types_1 = require(\"./types\");\nconst logger = new core_1.ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n (0, utils_1.assertIdentityPoolIdConfig)(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nexports.DefaultIdentityIdStore = DefaultIdentityIdStore;\nconst createKeysForAuthStorage = (provider, identifier) => {\n return (0, TokenStore_1.getAuthStorageKeys)(types_1.IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,sBAAsB,GAAG,KAAK,CAAC,CAAC;AACxC,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;AAClE,MAAM,sBAAsB,CAAC;AAC7B,IAAI,aAAa,CAAC,eAAe,EAAE;AACnC,QAAQ,IAAI,OAAO,CAAC,0BAA0B,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;AACzE,QAAQ,IAAI,CA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AC,CAAC;AAC1E,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;AACvC,YAAY,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACjF;AACA,YAAY,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAChD,SAAS;AACT,aAAa;AACb,YAAY,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,EAAE,CAAC;AAClD;AACA,YAAY,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACvE,SAAS;AACT,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAC5C,QAAQ,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACzE,KAAK;AACL,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACxD,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK;AAC3D,IAAI,OAAO,IAAI,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACtH,CAAC;;"}
1
+ {"version":3,"file":"IdentityIdStore.js","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultIdentityIdStore = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst TokenStore_1 = require(\"../tokenProvider/TokenStore\");\nconst types_1 = require(\"./types\");\nconst logger = new core_1.ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n (0, utils_1.assertIdentityPoolIdConfig)(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this._hasGuestIdentityId = false;\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n this._hasGuestIdentityId = true;\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n this._hasGuestIdentityId = true;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n if (this._hasGuestIdentityId) {\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n this._hasGuestIdentityId = false;\n }\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nexports.DefaultIdentityIdStore = DefaultIdentityIdStore;\nconst createKeysForAuthStorage = (provider, identifier) => {\n return (0, TokenStore_1.getAuthStorageKeys)(types_1.IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,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G,KAAK,CAAC;AACjD,aAAa;AACb,SAAS;AACT,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAC5C,QAAQ,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACzE,KAAK;AACL,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACxD,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK;AAC3D,IAAI,OAAO,IAAI,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACtH,CAAC;;"}
@@ -1,6 +1,6 @@
1
1
  export declare const DEFAULT_SERVICE_CLIENT_API_CONFIG: {
2
2
  service: string;
3
- retryDecider: (response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>;
3
+ retryDecider: (response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>;
4
4
  computeDelay: (attempt: number) => number;
5
5
  userAgentValue: string;
6
6
  cache: string;
@@ -4,7 +4,7 @@ export declare const createAssociateSoftwareTokenClient: (config: ServiceClientF
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createChangePasswordClient: (config: ServiceClientFactoryIn
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createConfirmDeviceClient: (config: ServiceClientFactoryInp
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createConfirmForgotPasswordClient: (config: ServiceClientFa
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createConfirmSignUpClient: (config: ServiceClientFactoryInp
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createDeleteUserAttributesClient: (config: ServiceClientFac
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createDeleteUserClient: (config: ServiceClientFactoryInput)
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createForgetDeviceClient: (config: ServiceClientFactoryInpu
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createForgotPasswordClient: (config: ServiceClientFactoryIn
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createGetUserAttributeVerificationCodeClient: (config: Serv
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createGetUserClient: (config: ServiceClientFactoryInput) =>
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createGlobalSignOutClient: (config: ServiceClientFactoryInp
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createInitiateAuthClient: (config: ServiceClientFactoryInpu
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createListDevicesClient: (config: ServiceClientFactoryInput
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createResendConfirmationCodeClient: (config: ServiceClientF
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createRespondToAuthChallengeClient: (config: ServiceClientF
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -9,7 +9,7 @@ export declare const createRevokeTokenClient: (config: ServiceClientFactoryInput
9
9
  url: URL;
10
10
  })) | undefined;
11
11
  service?: string | undefined;
12
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
12
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
13
13
  computeDelay?: ((attempt: number) => number) | undefined;
14
14
  userAgentValue?: string | undefined;
15
15
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createSetUserMFAPreferenceClient: (config: ServiceClientFac
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createSignUpClient: (config: ServiceClientFactoryInput) =>
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createUpdateDeviceStatusClient: (config: ServiceClientFacto
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createUpdateUserAttributesClient: (config: ServiceClientFac
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createVerifySoftwareTokenClient: (config: ServiceClientFact
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -4,7 +4,7 @@ export declare const createVerifyUserAttributeClient: (config: ServiceClientFact
4
4
  url: URL;
5
5
  })) | undefined;
6
6
  service?: string | undefined;
7
- retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
7
+ retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext | undefined) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
8
8
  computeDelay?: ((attempt: number) => number) | undefined;
9
9
  userAgentValue?: string | undefined;
10
10
  cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
@@ -6,6 +6,7 @@ export declare class DefaultIdentityIdStore implements IdentityIdStore {
6
6
  authConfig?: AuthConfig;
7
7
  _primaryIdentityId: string | undefined;
8
8
  _authKeys: AuthKeys<string>;
9
+ _hasGuestIdentityId: boolean;
9
10
  setAuthConfig(authConfigParam: AuthConfig): void;
10
11
  constructor(keyValueStorage: KeyValueStorageInterface);
11
12
  loadIdentityId(): Promise<Identity | null>;
@@ -14,6 +14,7 @@ class DefaultIdentityIdStore {
14
14
  }
15
15
  constructor(keyValueStorage) {
16
16
  this._authKeys = {};
17
+ this._hasGuestIdentityId = false;
17
18
  this.keyValueStorage = keyValueStorage;
18
19
  }
19
20
  async loadIdentityId() {
@@ -28,6 +29,7 @@ class DefaultIdentityIdStore {
28
29
  else {
29
30
  const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);
30
31
  if (storedIdentityId) {
32
+ this._hasGuestIdentityId = true;
31
33
  return {
32
34
  id: storedIdentityId,
33
35
  type: 'guest',
@@ -47,11 +49,15 @@ class DefaultIdentityIdStore {
47
49
  this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);
48
50
  // Clear in-memory storage of primary identityId
49
51
  this._primaryIdentityId = undefined;
52
+ this._hasGuestIdentityId = true;
50
53
  }
51
54
  else {
52
55
  this._primaryIdentityId = identity.id;
53
56
  // Clear locally stored guest id
54
- this.keyValueStorage.removeItem(this._authKeys.identityId);
57
+ if (this._hasGuestIdentityId) {
58
+ this.keyValueStorage.removeItem(this._authKeys.identityId);
59
+ this._hasGuestIdentityId = false;
60
+ }
55
61
  }
56
62
  }
57
63
  async clearIdentityId() {
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityIdStore.mjs","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger, } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore';\nimport { IdentityIdStorageKeys } from './types';\nconst logger = new ConsoleLogger('DefaultIdentityIdStore');\nexport class DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n assertIdentityPoolIdConfig(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,wBAAwB,CAAC,CAAC;AACpD,MAAM,sBAAsB,C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eAAe,CAAC,QAAQ,EAAE;AACpC,QAAQ,0BAA0B,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC7D,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;AACvC,YAAY,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACjF;AACA,YAAY,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAChD,SAAS;AACT,aAAa;AACb,YAAY,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,EAAE,CAAC;AAClD;AACA,YAAY,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACvE,SAAS;AACT,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAC5C,QAAQ,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACzE,KAAK;AACL,CAAC;AACD,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK;AAC3D,IAAI,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAC5F,CAAC;;;;"}
1
+ {"version":3,"file":"IdentityIdStore.mjs","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger, } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore';\nimport { IdentityIdStorageKeys } from './types';\nconst logger = new ConsoleLogger('DefaultIdentityIdStore');\nexport class DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n assertIdentityPoolIdConfig(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this._hasGuestIdentityId = false;\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n this._hasGuestIdentityId = true;\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n this._hasGuestIdentityId = true;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n if (this._hasGuestIdentityId) {\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n this._hasGuestIdentityId = false;\n }\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,wBAAwB,CAAC,CAAC;AACpD,MAAM,sBAAsB,CAAC;AACpC,IAAI,aAAa,CAAC,eAAe,EAAE;AACnC,QAAQ,0BAA0B,CAAC,eAAe,CAAC,O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/index.js",
6
- "module": "./dist/esm/index.mjs",
7
- "typings": "./dist/esm/index.d.ts",
8
- "react-native": "./src/index.ts",
9
- "sideEffects": [
10
- "./dist/cjs/providers/cognito/apis/signInWithRedirect.js",
11
- "./dist/esm/providers/cognito/apis/signInWithRedirect.mjs",
12
- "./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js",
13
- "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs"
14
- ],
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
- "scripts": {
19
- "test": "yarn lint --fix && jest -w 1 --coverage --logHeapUsage",
20
- "build-with-test": "npm test && npm run build",
21
- "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
22
- "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
23
- "build:watch": "npm run build:esm-cjs -- --watch",
24
- "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
25
- "clean": "npm run clean:size && rimraf lib-esm lib dist",
26
- "clean:size": "rimraf dual-publish-tmp tmp*",
27
- "format": "echo \"Not implemented\"",
28
- "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
29
- "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
30
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.18"
31
- },
32
- "typesVersions": {
33
- ">=4.2": {
34
- "cognito": [
35
- "./dist/esm/providers/cognito/index.d.ts"
36
- ],
37
- "cognito/server": [
38
- "./dist/esm/providers/cognito/apis/server/index.d.ts"
39
- ],
40
- "server": [
41
- "./dist/esm/server.d.ts"
42
- ]
43
- }
44
- },
45
- "exports": {
46
- ".": {
47
- "types": "./dist/esm/index.d.ts",
48
- "import": "./dist/esm/index.mjs",
49
- "require": "./dist/cjs/index.js",
50
- "react-native": "./src/index.ts"
51
- },
52
- "./cognito": {
53
- "types": "./dist/esm/providers/cognito/index.d.ts",
54
- "import": "./dist/esm/providers/cognito/index.mjs",
55
- "require": "./dist/cjs/providers/cognito/index.js",
56
- "react-native": "./src/providers/cognito/index.ts"
57
- },
58
- "./cognito/server": {
59
- "types": "./dist/esm/providers/cognito/apis/server/index.d.ts",
60
- "import": "./dist/esm/providers/cognito/apis/server/index.mjs",
61
- "require": "./dist/cjs/providers/cognito/apis/server/index.js"
62
- },
63
- "./server": {
64
- "types": "./dist/esm/server.d.ts",
65
- "import": "./dist/esm/server.mjs",
66
- "require": "./dist/cjs/server.js"
67
- },
68
- "./enable-oauth-listener": {
69
- "types": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.d.ts",
70
- "import": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs",
71
- "require": "./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js"
72
- },
73
- "./package.json": "./package.json"
74
- },
75
- "repository": {
76
- "type": "git",
77
- "url": "https://github.com/aws-amplify/amplify-js.git"
78
- },
79
- "author": "Amazon Web Services",
80
- "license": "Apache-2.0",
81
- "bugs": {
82
- "url": "https://github.com/aws/aws-amplify/issues"
83
- },
84
- "homepage": "https://aws-amplify.github.io/",
85
- "files": [
86
- "dist/cjs",
87
- "dist/esm",
88
- "src",
89
- "cognito",
90
- "server",
91
- "enable-oauth-listener"
92
- ],
93
- "dependencies": {
94
- "tslib": "^2.5.0"
95
- },
96
- "peerDependencies": {
97
- "@aws-amplify/core": "^6.1.0"
98
- },
99
- "devDependencies": {
100
- "@aws-amplify/core": "6.4.2",
101
- "@aws-amplify/react-native": "1.1.5",
102
- "@jest/test-sequencer": "^29.7.0",
103
- "typescript": "5.0.2"
104
- },
105
- "gitHead": "716cc95cb08bc1e700b3f57752457be28d18e4fd"
2
+ "name": "@aws-amplify/auth",
3
+ "version": "6.4.3-storage-browser.cf3aed2.0+cf3aed2",
4
+ "description": "Auth category of aws-amplify",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.mjs",
7
+ "typings": "./dist/esm/index.d.ts",
8
+ "react-native": "./src/index.ts",
9
+ "sideEffects": [
10
+ "./dist/cjs/providers/cognito/apis/signInWithRedirect.js",
11
+ "./dist/esm/providers/cognito/apis/signInWithRedirect.mjs",
12
+ "./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js",
13
+ "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "scripts": {
19
+ "test": "yarn lint --fix && jest -w 1 --coverage --logHeapUsage",
20
+ "build-with-test": "npm test && npm run build",
21
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
22
+ "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
23
+ "build:watch": "npm run build:esm-cjs -- --watch",
24
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
25
+ "clean": "npm run clean:size && rimraf lib-esm lib dist",
26
+ "clean:size": "rimraf dual-publish-tmp tmp*",
27
+ "format": "echo \"Not implemented\"",
28
+ "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
29
+ "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
30
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.18"
31
+ },
32
+ "typesVersions": {
33
+ ">=4.2": {
34
+ "cognito": [
35
+ "./dist/esm/providers/cognito/index.d.ts"
36
+ ],
37
+ "cognito/server": [
38
+ "./dist/esm/providers/cognito/apis/server/index.d.ts"
39
+ ],
40
+ "server": [
41
+ "./dist/esm/server.d.ts"
42
+ ]
43
+ }
44
+ },
45
+ "exports": {
46
+ ".": {
47
+ "types": "./dist/esm/index.d.ts",
48
+ "import": "./dist/esm/index.mjs",
49
+ "require": "./dist/cjs/index.js",
50
+ "react-native": "./src/index.ts"
51
+ },
52
+ "./cognito": {
53
+ "types": "./dist/esm/providers/cognito/index.d.ts",
54
+ "import": "./dist/esm/providers/cognito/index.mjs",
55
+ "require": "./dist/cjs/providers/cognito/index.js",
56
+ "react-native": "./src/providers/cognito/index.ts"
57
+ },
58
+ "./cognito/server": {
59
+ "types": "./dist/esm/providers/cognito/apis/server/index.d.ts",
60
+ "import": "./dist/esm/providers/cognito/apis/server/index.mjs",
61
+ "require": "./dist/cjs/providers/cognito/apis/server/index.js"
62
+ },
63
+ "./server": {
64
+ "types": "./dist/esm/server.d.ts",
65
+ "import": "./dist/esm/server.mjs",
66
+ "require": "./dist/cjs/server.js"
67
+ },
68
+ "./enable-oauth-listener": {
69
+ "types": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.d.ts",
70
+ "import": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs",
71
+ "require": "./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js"
72
+ },
73
+ "./package.json": "./package.json"
74
+ },
75
+ "repository": {
76
+ "type": "git",
77
+ "url": "https://github.com/aws-amplify/amplify-js.git"
78
+ },
79
+ "author": "Amazon Web Services",
80
+ "license": "Apache-2.0",
81
+ "bugs": {
82
+ "url": "https://github.com/aws/aws-amplify/issues"
83
+ },
84
+ "homepage": "https://aws-amplify.github.io/",
85
+ "files": [
86
+ "dist/cjs",
87
+ "dist/esm",
88
+ "src",
89
+ "cognito",
90
+ "server",
91
+ "enable-oauth-listener"
92
+ ],
93
+ "dependencies": {
94
+ "tslib": "^2.5.0"
95
+ },
96
+ "peerDependencies": {
97
+ "@aws-amplify/core": "6.4.3-storage-browser.cf3aed2.0+cf3aed2"
98
+ },
99
+ "devDependencies": {
100
+ "@aws-amplify/core": "6.4.3-storage-browser.cf3aed2.0+cf3aed2",
101
+ "@aws-amplify/react-native": "1.1.6-storage-browser.cf3aed2.0+cf3aed2",
102
+ "@jest/test-sequencer": "^29.7.0",
103
+ "typescript": "5.0.2"
104
+ },
105
+ "gitHead": "cf3aed227dcd25cb533c456c77945da1712c7c1b"
106
106
  }
@@ -23,6 +23,8 @@ export class DefaultIdentityIdStore implements IdentityIdStore {
23
23
  // Used as in-memory storage
24
24
  _primaryIdentityId: string | undefined;
25
25
  _authKeys: AuthKeys<string> = {};
26
+ _hasGuestIdentityId = false;
27
+
26
28
  setAuthConfig(authConfigParam: AuthConfig) {
27
29
  assertIdentityPoolIdConfig(authConfigParam.Cognito);
28
30
  this.authConfig = authConfigParam;
@@ -48,7 +50,10 @@ export class DefaultIdentityIdStore implements IdentityIdStore {
48
50
  const storedIdentityId = await this.keyValueStorage.getItem(
49
51
  this._authKeys.identityId,
50
52
  );
53
+
51
54
  if (storedIdentityId) {
55
+ this._hasGuestIdentityId = true;
56
+
52
57
  return {
53
58
  id: storedIdentityId,
54
59
  type: 'guest',
@@ -71,10 +76,14 @@ export class DefaultIdentityIdStore implements IdentityIdStore {
71
76
  this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);
72
77
  // Clear in-memory storage of primary identityId
73
78
  this._primaryIdentityId = undefined;
79
+ this._hasGuestIdentityId = true;
74
80
  } else {
75
81
  this._primaryIdentityId = identity.id;
76
82
  // Clear locally stored guest id
77
- this.keyValueStorage.removeItem(this._authKeys.identityId);
83
+ if (this._hasGuestIdentityId) {
84
+ this.keyValueStorage.removeItem(this._authKeys.identityId);
85
+ this._hasGuestIdentityId = false;
86
+ }
78
87
  }
79
88
  }
80
89