@aws-amplify/auth 6.5.1-events.81620c6.0 → 6.5.1-storage-browser.4db9fef.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 (30) hide show
  1. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.js +3 -1
  2. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.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/utils/oauth/getRedirectUrl.mjs +3 -1
  28. package/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs.map +1 -1
  29. package/package.json +5 -5
  30. package/src/providers/cognito/utils/oauth/getRedirectUrl.ts +1 -0
@@ -29,7 +29,9 @@ function getRedirectUrl(redirects, preferredRedirectUrl) {
29
29
  }
30
30
  exports.getRedirectUrl = getRedirectUrl;
31
31
  // origin + pathname => https://example.com/app
32
- const isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));
32
+ const isSameOriginAndPathName = (redirect) => redirect.startsWith(
33
+ // eslint-disable-next-line no-constant-binary-expression
34
+ String(window.location.origin + window.location.pathname ?? '/'));
33
35
  // domain => outlook.live.com, github.com
34
36
  const isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));
35
37
  const isHttp = (redirect) => redirect.startsWith('http://');
@@ -1 +1 @@
1
- {"version":3,"file":"getRedirectUrl.js","sources":["../../../../../../src/providers/cognito/utils/oauth/getRedirectUrl.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRedirectUrl = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constants_1 = require(\"../../../../errors/constants\");\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw constants_1.invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw constants_1.invalidOriginException;\n }\n throw constants_1.invalidRedirectException;\n }\n}\nexports.getRedirectUrl = getRedirectUrl;\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC;AACA;AACA,MAAM,WAAW,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC5D;AACA,SAAS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U,CAAC,SAAS,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;"}
1
+ {"version":3,"file":"getRedirectUrl.js","sources":["../../../../../../src/providers/cognito/utils/oauth/getRedirectUrl.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRedirectUrl = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constants_1 = require(\"../../../../errors/constants\");\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw constants_1.invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw constants_1.invalidOriginException;\n }\n throw constants_1.invalidRedirectException;\n }\n}\nexports.getRedirectUrl = getRedirectUrl;\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(\n// eslint-disable-next-line no-constant-binary-expression\nString(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,C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CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,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;
@@ -25,7 +25,9 @@ function getRedirectUrl(redirects, preferredRedirectUrl) {
25
25
  }
26
26
  }
27
27
  // origin + pathname => https://example.com/app
28
- const isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));
28
+ const isSameOriginAndPathName = (redirect) => redirect.startsWith(
29
+ // eslint-disable-next-line no-constant-binary-expression
30
+ String(window.location.origin + window.location.pathname ?? '/'));
29
31
  // domain => outlook.live.com, github.com
30
32
  const isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));
31
33
  const isHttp = (redirect) => redirect.startsWith('http://');
@@ -1 +1 @@
1
- {"version":3,"file":"getRedirectUrl.mjs","sources":["../../../../../../src/providers/cognito/utils/oauth/getRedirectUrl.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { invalidOriginException, invalidPreferredRedirectUrlException, invalidRedirectException, } from '../../../../errors/constants';\n/** @internal */\nexport function getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw invalidOriginException;\n }\n throw invalidRedirectException;\n }\n}\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACO,SAAS,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE;AAChE,IAAI,IAAI,oBAAoB,EAAE;AAC9B,QAAQ,MAAM,WAAW,GAAG,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,oB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rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { invalidOriginException, invalidPreferredRedirectUrlException, invalidRedirectException, } from '../../../../errors/constants';\n/** @internal */\nexport function getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw invalidOriginException;\n }\n throw invalidRedirectException;\n }\n}\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(\n// eslint-disable-next-line no-constant-binary-expression\nString(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACO,SAAS,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE;AAChE,IAAI,IAAI,oBAAoB,EAAE;AAC9B,QAAQ,MAAM,WAAW,GAAG,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,oBAAoB,CAAC,CAAC;AAC3F,QAAQ,IAAI,CAAC,WAAW,EAAE;AAC1B,YAAY,MAAM,oCAAoC,CAAC;AACvD,SAAS;AACT,QAAQ,OAAO,WAAW,CAAC;AAC3B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,4BAA4B,GAAG,SAAS,EAAE,IAAI,CAAC,uBAAuB,CAAC;AACrF,YAAY,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AAC7C,QAAQ,MAAM,8BAA8B,GAAG,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;AACnG,QAAQ,IAAI,4BAA4B,EAAE;AAC1C,YAAY,OAAO,4BAA4B,CAAC;AAChD,SAAS;AACT,aAAa,IAAI,8BAA8B,EAAE;AACjD,YAAY,MAAM,sBAAsB,CAAC;AACzC,SAAS;AACT,QAAQ,MAAM,wBAAwB,CAAC;AACvC,KAAK;AACL,CAAC;AACD;AACA,MAAM,uBAAuB,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU;AACjE;AACA,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC;AAClE;AACA,MAAM,eAAe,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/auth",
3
- "version": "6.5.1-events.81620c6.0+81620c6",
3
+ "version": "6.5.1-storage-browser.4db9fef.0+4db9fef",
4
4
  "description": "Auth category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -94,13 +94,13 @@
94
94
  "tslib": "^2.5.0"
95
95
  },
96
96
  "peerDependencies": {
97
- "@aws-amplify/core": "6.4.4-events.81620c6.0+81620c6"
97
+ "@aws-amplify/core": "6.4.4-storage-browser.4db9fef.0+4db9fef"
98
98
  },
99
99
  "devDependencies": {
100
- "@aws-amplify/core": "6.4.4-events.81620c6.0+81620c6",
101
- "@aws-amplify/react-native": "1.1.7-events.81620c6.0+81620c6",
100
+ "@aws-amplify/core": "6.4.4-storage-browser.4db9fef.0+4db9fef",
101
+ "@aws-amplify/react-native": "1.1.7-storage-browser.4db9fef.0+4db9fef",
102
102
  "@jest/test-sequencer": "^29.7.0",
103
103
  "typescript": "5.0.2"
104
104
  },
105
- "gitHead": "81620c6dbe7e277a2f401fe967a1fb9c556b9341"
105
+ "gitHead": "4db9fef916a74e0a7cd5d3060e117e05cf7d91b5"
106
106
  }
@@ -39,6 +39,7 @@ export function getRedirectUrl(
39
39
  // origin + pathname => https://example.com/app
40
40
  const isSameOriginAndPathName = (redirect: string) =>
41
41
  redirect.startsWith(
42
+ // eslint-disable-next-line no-constant-binary-expression
42
43
  String(window.location.origin + window.location.pathname ?? '/'),
43
44
  );
44
45
  // domain => outlook.live.com, github.com