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AAAD,EACA,OAEA,IAAAE,EAAAF,EAAAG,OAAA,CAAA1E,EAAA/C,EAAA/F,UACA,EACA,CACAyN,YAAAF,CACA,EAGA,EACA,mFCfA,IAAAtH,EAAA,CAAAyH,EAAAC,IAAkE,GAAAC,EAAAC,EAAA,EAAmB,CACrFC,SAAcC,EAAAC,EAAQ,CAAAnQ,IAAA,CACtB6P,OAAAA,EACA,GAAAC,CAAA,oFCCA,OAAAM,UAA6BC,EAAAC,CAAe,CAC5CtM,aAAA,CACA,MAAc,GAAAhC,EAAAuO,CAAA,IACd,CACA,cCJA,OAAAC,UAA6BH,EAAAC,CAAe,CAC5CtM,aAAA,CACA,MAAc,GAAAhC,EAAAmF,CAAA,IACd,CACA,CCJA,IAAAsJ,EAAA,IAA2BL,EAC3B,IAA2BI,EAC3B,IAAkCH,EAAAC,CAAe,KAAKI,EAAAC,CAAe","sources":["webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/singleton/apis/clearCredentials.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/completeOAuthSignOut.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/utils/openAuthSession.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthSignOutRedirect.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/handleOAuthSignOut.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signOut.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/tokenProvider.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/userContextData.mjs","webpack://_N_E/./node_modules/@aws-amplify/auth/dist/esm/utils/getAuthUserAgentValue.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs"],"sourcesContent":["import { Amplify } from '../Amplify.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction clearCredentials() {\n return Amplify.Auth.clearCredentials();\n}\n\nexport { clearCredentials };\n//# sourceMappingURL=clearCredentials.mjs.map\n","import { clearCredentials, Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport '../refreshAuthTokens.mjs';\nimport '../../tokenProvider/errorHelpers.mjs';\nimport { tokenOrchestrator } from '../../tokenProvider/tokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst completeOAuthSignOut = async (store) => {\n await store.clearOAuthData();\n tokenOrchestrator.clearTokens();\n await clearCredentials();\n Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nexport { completeOAuthSignOut };\n//# sourceMappingURL=completeOAuthSignOut.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst openAuthSession = async (url) => {\n if (!window?.location) {\n return;\n }\n // enforce HTTPS\n window.location.href = url.replace('http://', 'https://');\n};\n\nexport { openAuthSession };\n//# sourceMappingURL=openAuthSession.mjs.map\n","import { invalidOriginException, invalidRedirectException } from '../../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/** @internal */\nfunction getRedirectUrl(redirects) {\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// 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\nexport { getRedirectUrl };\n//# sourceMappingURL=getRedirectUrl.mjs.map\n","import { assertOAuthConfig } from '@aws-amplify/core/internals/utils';\nimport { openAuthSession } from '../../../../utils/openAuthSession.mjs';\nimport { getRedirectUrl } from './getRedirectUrl.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst oAuthSignOutRedirect = async (authConfig, preferPrivateSession = false) => {\n assertOAuthConfig(authConfig);\n const { loginWith, userPoolClientId } = authConfig;\n const { domain, redirectSignOut } = loginWith.oauth;\n const signoutUri = getRedirectUrl(redirectSignOut);\n const oAuthLogoutEndpoint = `https://${domain}/logout?${Object.entries({\n client_id: userPoolClientId,\n logout_uri: encodeURIComponent(signoutUri),\n })\n .map(([k, v]) => `${k}=${v}`)\n .join('&')}`;\n return openAuthSession(oAuthLogoutEndpoint);\n};\n\nexport { oAuthSignOutRedirect };\n//# sourceMappingURL=oAuthSignOutRedirect.mjs.map\n","import { completeOAuthSignOut } from './completeOAuthSignOut.mjs';\nimport { oAuthSignOutRedirect } from './oAuthSignOutRedirect.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst handleOAuthSignOut = async (cognitoConfig, store) => {\n const { isOAuthSignIn } = await store.loadOAuthSignIn();\n // Clear everything before attempting to visted logout endpoint since the current application\n // state could be wiped away on redirect\n await completeOAuthSignOut(store);\n if (isOAuthSignIn) {\n // On web, this will always end up being a void action\n return oAuthSignOutRedirect(cognitoConfig);\n }\n};\n\nexport { handleOAuthSignOut };\n//# sourceMappingURL=handleOAuthSignOut.mjs.map\n","import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { OAuthStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst V5_HOSTED_UI_KEY = 'amplify-signin-with-hostedUI';\nconst name = 'CognitoIdentityServiceProvider';\nclass DefaultOAuthStore {\n constructor(keyValueStorage) {\n this.keyValueStorage = keyValueStorage;\n }\n async clearOAuthInflightData() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await Promise.all([\n this.keyValueStorage.removeItem(authKeys.inflightOAuth),\n this.keyValueStorage.removeItem(authKeys.oauthPKCE),\n this.keyValueStorage.removeItem(authKeys.oauthState),\n ]);\n }\n async clearOAuthData() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.clearOAuthInflightData();\n await this.keyValueStorage.removeItem(V5_HOSTED_UI_KEY); // remove in case a customer migrated an App from v5 to v6\n return this.keyValueStorage.removeItem(authKeys.oauthSignIn);\n }\n loadOAuthState() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.getItem(authKeys.oauthState);\n }\n storeOAuthState(state) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.setItem(authKeys.oauthState, state);\n }\n loadPKCE() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.getItem(authKeys.oauthPKCE);\n }\n storePKCE(pkce) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.setItem(authKeys.oauthPKCE, pkce);\n }\n setAuthConfig(authConfigParam) {\n this.cognitoConfig = authConfigParam;\n }\n async loadOAuthInFlight() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return ((await this.keyValueStorage.getItem(authKeys.inflightOAuth)) === 'true');\n }\n async storeOAuthInFlight(inflight) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.keyValueStorage.setItem(authKeys.inflightOAuth, `${inflight}`);\n }\n async loadOAuthSignIn() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n const isLegacyHostedUISignIn = await this.keyValueStorage.getItem(V5_HOSTED_UI_KEY);\n const [isOAuthSignIn, preferPrivateSession] = (await this.keyValueStorage.getItem(authKeys.oauthSignIn))?.split(',') ??\n [];\n return {\n isOAuthSignIn: isOAuthSignIn === 'true' || isLegacyHostedUISignIn === 'true',\n preferPrivateSession: preferPrivateSession === 'true',\n };\n }\n async storeOAuthSignIn(oauthSignIn, preferPrivateSession = false) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.keyValueStorage.setItem(authKeys.oauthSignIn, `${oauthSignIn},${preferPrivateSession}`);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(OAuthStorageKeys)(provider, identifier);\n};\n\nexport { DefaultOAuthStore };\n//# sourceMappingURL=signInWithRedirectStore.mjs.map\n","import { ConsoleLogger, Amplify, clearCredentials, Hub, defaultStorage } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, assertOAuthConfig, AMPLIFY_SYMBOL, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { revokeToken, globalSignOut as globalSignOut$1 } from '../utils/clients/CognitoIdentityProvider/index.mjs';\nimport { getRegion } from '../utils/clients/CognitoIdentityProvider/utils.mjs';\nimport { assertAuthTokensWithRefreshToken, assertAuthTokens } from '../utils/types.mjs';\nimport '@aws-crypto/sha256-js';\nimport { handleOAuthSignOut } from '../utils/oauth/handleOAuthSignOut.mjs';\nimport { OAUTH_SIGNOUT_EXCEPTION } from '../../../errors/constants.mjs';\nimport { DefaultOAuthStore } from '../utils/signInWithRedirectStore.mjs';\nimport '../../../Errors.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../types/Auth.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('Auth');\n/**\n * Signs a user out\n *\n * @param input - The SignOutInput object\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signOut(input) {\n const cognitoConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(cognitoConfig);\n if (input?.global) {\n await globalSignOut(cognitoConfig);\n }\n else {\n await clientSignOut(cognitoConfig);\n }\n let hasOAuthConfig;\n try {\n assertOAuthConfig(cognitoConfig);\n hasOAuthConfig = true;\n }\n catch (err) {\n hasOAuthConfig = false;\n }\n if (hasOAuthConfig) {\n const oAuthStore = new DefaultOAuthStore(defaultStorage);\n oAuthStore.setAuthConfig(cognitoConfig);\n const { type } = (await handleOAuthSignOut(cognitoConfig, oAuthStore)) ?? {};\n if (type === 'error') {\n throw new AuthError({\n name: OAUTH_SIGNOUT_EXCEPTION,\n message: 'An error occurred when attempting to log out from OAuth provider.',\n });\n }\n }\n else {\n // complete sign out\n tokenOrchestrator.clearTokens();\n await clearCredentials();\n Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n }\n}\nasync function clientSignOut(cognitoConfig) {\n try {\n const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n assertAuthTokensWithRefreshToken(authTokens);\n if (isSessionRevocable(authTokens.accessToken)) {\n await revokeToken({\n region: getRegion(cognitoConfig.userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n }, {\n ClientId: cognitoConfig.userPoolClientId,\n Token: authTokens.refreshToken,\n });\n }\n }\n catch (err) {\n // this shouldn't throw\n logger.debug('Client signOut error caught but will proceed with token removal');\n }\n}\nasync function globalSignOut(cognitoConfig) {\n try {\n const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n assertAuthTokens(authTokens);\n await globalSignOut$1({\n region: getRegion(cognitoConfig.userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n }, {\n AccessToken: authTokens.accessToken.toString(),\n });\n }\n catch (err) {\n // it should not throw\n logger.debug('Global signOut error caught but will proceed with token removal');\n }\n}\nconst isSessionRevocable = (token) => !!token?.payload?.origin_jti;\n\nexport { signOut };\n//# sourceMappingURL=signOut.mjs.map\n","const AuthTokenStorageKeys = {\n accessToken: 'accessToken',\n idToken: 'idToken',\n oidcProvider: 'oidcProvider',\n clockDrift: 'clockDrift',\n refreshToken: 'refreshToken',\n deviceKey: 'deviceKey',\n randomPasswordKey: 'randomPasswordKey',\n deviceGroupKey: 'deviceGroupKey',\n signInDetails: 'signInDetails',\n};\n\nexport { AuthTokenStorageKeys };\n//# sourceMappingURL=types.mjs.map\n","import { createAssertionFunction } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar TokenProviderErrorCode;\n(function (TokenProviderErrorCode) {\n TokenProviderErrorCode[\"InvalidAuthTokens\"] = \"InvalidAuthTokens\";\n})(TokenProviderErrorCode || (TokenProviderErrorCode = {}));\nconst tokenValidationErrorMap = {\n [TokenProviderErrorCode.InvalidAuthTokens]: {\n message: 'Invalid tokens.',\n recoverySuggestion: 'Make sure the tokens are valid.',\n },\n};\nconst assert = createAssertionFunction(tokenValidationErrorMap);\n\nexport { TokenProviderErrorCode, assert };\n//# sourceMappingURL=errorHelpers.mjs.map\n","import { decodeJWT, assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { AuthTokenStorageKeys } from './types.mjs';\nimport { assert, TokenProviderErrorCode } from './errorHelpers.mjs';\n\nclass DefaultTokenStore {\n constructor() {\n this.name = 'CognitoIdentityServiceProvider'; // To be backwards compatible with V5, no migration needed\n }\n getKeyValueStorage() {\n if (!this.keyValueStorage) {\n throw new AuthError({\n name: 'KeyValueStorageNotFoundException',\n message: 'KeyValueStorage was not found in TokenStore',\n });\n }\n return this.keyValueStorage;\n }\n setKeyValueStorage(keyValueStorage) {\n this.keyValueStorage = keyValueStorage;\n }\n setAuthConfig(authConfig) {\n this.authConfig = authConfig;\n }\n async loadTokens() {\n // TODO(v6): migration logic should be here\n // Reading V5 tokens old format\n try {\n const authKeys = await this.getAuthKeys();\n const accessTokenString = await this.getKeyValueStorage().getItem(authKeys.accessToken);\n if (!accessTokenString) {\n throw new AuthError({\n name: 'NoSessionFoundException',\n message: 'Auth session was not found. Make sure to call signIn.',\n });\n }\n const accessToken = decodeJWT(accessTokenString);\n const itString = await this.getKeyValueStorage().getItem(authKeys.idToken);\n const idToken = itString ? decodeJWT(itString) : undefined;\n const refreshToken = (await this.getKeyValueStorage().getItem(authKeys.refreshToken)) ??\n undefined;\n const clockDriftString = (await this.getKeyValueStorage().getItem(authKeys.clockDrift)) ?? '0';\n const clockDrift = Number.parseInt(clockDriftString);\n const signInDetails = await this.getKeyValueStorage().getItem(authKeys.signInDetails);\n const tokens = {\n accessToken,\n idToken,\n refreshToken,\n deviceMetadata: (await this.getDeviceMetadata()) ?? undefined,\n clockDrift,\n username: await this.getLastAuthUser(),\n };\n if (signInDetails) {\n tokens.signInDetails = JSON.parse(signInDetails);\n }\n return tokens;\n }\n catch (err) {\n return null;\n }\n }\n async storeTokens(tokens) {\n assert(tokens !== undefined, TokenProviderErrorCode.InvalidAuthTokens);\n await this.clearTokens();\n const lastAuthUser = tokens.username;\n await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(), lastAuthUser);\n const authKeys = await this.getAuthKeys();\n await this.getKeyValueStorage().setItem(authKeys.accessToken, tokens.accessToken.toString());\n if (tokens.idToken) {\n await this.getKeyValueStorage().setItem(authKeys.idToken, tokens.idToken.toString());\n }\n if (tokens.refreshToken) {\n await this.getKeyValueStorage().setItem(authKeys.refreshToken, tokens.refreshToken);\n }\n if (tokens.deviceMetadata) {\n if (tokens.deviceMetadata.deviceKey) {\n await this.getKeyValueStorage().setItem(authKeys.deviceKey, tokens.deviceMetadata.deviceKey);\n }\n if (tokens.deviceMetadata.deviceGroupKey) {\n await this.getKeyValueStorage().setItem(authKeys.deviceGroupKey, tokens.deviceMetadata.deviceGroupKey);\n }\n await this.getKeyValueStorage().setItem(authKeys.randomPasswordKey, tokens.deviceMetadata.randomPassword);\n }\n if (tokens.signInDetails) {\n await this.getKeyValueStorage().setItem(authKeys.signInDetails, JSON.stringify(tokens.signInDetails));\n }\n await this.getKeyValueStorage().setItem(authKeys.clockDrift, `${tokens.clockDrift}`);\n }\n async clearTokens() {\n const authKeys = await this.getAuthKeys();\n // Not calling clear because it can remove data that is not managed by AuthTokenStore\n await Promise.all([\n this.getKeyValueStorage().removeItem(authKeys.accessToken),\n this.getKeyValueStorage().removeItem(authKeys.idToken),\n this.getKeyValueStorage().removeItem(authKeys.clockDrift),\n this.getKeyValueStorage().removeItem(authKeys.refreshToken),\n this.getKeyValueStorage().removeItem(authKeys.signInDetails),\n this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),\n ]);\n }\n async getDeviceMetadata(username) {\n const authKeys = await this.getAuthKeys(username);\n const deviceKey = await this.getKeyValueStorage().getItem(authKeys.deviceKey);\n const deviceGroupKey = await this.getKeyValueStorage().getItem(authKeys.deviceGroupKey);\n const randomPassword = await this.getKeyValueStorage().getItem(authKeys.randomPasswordKey);\n return randomPassword\n ? {\n deviceKey: deviceKey ?? undefined,\n deviceGroupKey: deviceGroupKey ?? undefined,\n randomPassword,\n }\n : null;\n }\n async clearDeviceMetadata(username) {\n const authKeys = await this.getAuthKeys(username);\n await Promise.all([\n this.getKeyValueStorage().removeItem(authKeys.deviceKey),\n this.getKeyValueStorage().removeItem(authKeys.deviceGroupKey),\n this.getKeyValueStorage().removeItem(authKeys.randomPasswordKey),\n ]);\n }\n async getAuthKeys(username) {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n const lastAuthUser = username ?? (await this.getLastAuthUser());\n return createKeysForAuthStorage(this.name, `${this.authConfig.Cognito.userPoolClientId}.${lastAuthUser}`);\n }\n getLastAuthUserKey() {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n const identifier = this.authConfig.Cognito.userPoolClientId;\n return `${this.name}.${identifier}.LastAuthUser`;\n }\n async getLastAuthUser() {\n const lastAuthUser = (await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())) ??\n 'username';\n return lastAuthUser;\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(AuthTokenStorageKeys)(`${provider}`, identifier);\n};\nfunction getAuthStorageKeys(authKeys) {\n const keys = Object.values({ ...authKeys });\n return (prefix, identifier) => keys.reduce((acc, authKey) => ({\n ...acc,\n [authKey]: `${prefix}.${identifier}.${authKey}`,\n }), {});\n}\n\nexport { DefaultTokenStore, createKeysForAuthStorage, getAuthStorageKeys };\n//# sourceMappingURL=TokenStore.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * returns in-flight promise if there is one\n *\n * @param asyncFunction - asyncFunction to be deduped.\n * @returns - the return type of the callback\n */\nconst deDupeAsyncFunction = (asyncFunction) => {\n let inflightPromise;\n return async (...args) => {\n if (inflightPromise)\n return inflightPromise;\n inflightPromise = new Promise((resolve, reject) => {\n asyncFunction(...args)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n reject(error);\n })\n .finally(() => {\n inflightPromise = undefined;\n });\n });\n return inflightPromise;\n };\n};\n\nexport { deDupeAsyncFunction };\n//# sourceMappingURL=deDupeAsyncFunction.mjs.map\n","import { deDupeAsyncFunction, assertTokenProviderConfig, decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { initiateAuth } from './clients/CognitoIdentityProvider/index.mjs';\nimport { getRegion } from './clients/CognitoIdentityProvider/utils.mjs';\nimport { assertAuthTokensWithRefreshToken } from './types.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { getUserContextData } from './userContextData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {\n assertTokenProviderConfig(authConfig?.Cognito);\n const region = getRegion(authConfig.Cognito.userPoolId);\n assertAuthTokensWithRefreshToken(tokens);\n const refreshTokenString = tokens.refreshToken;\n const AuthParameters = {\n REFRESH_TOKEN: refreshTokenString,\n };\n if (tokens.deviceMetadata?.deviceKey) {\n AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId: authConfig.Cognito.userPoolId,\n userPoolClientId: authConfig.Cognito.userPoolClientId,\n });\n const { AuthenticationResult } = await initiateAuth({ region }, {\n ClientId: authConfig?.Cognito?.userPoolClientId,\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters,\n UserContextData,\n });\n const accessToken = decodeJWT(AuthenticationResult?.AccessToken ?? '');\n const idToken = AuthenticationResult?.IdToken\n ? decodeJWT(AuthenticationResult.IdToken)\n : undefined;\n const { iat } = accessToken.payload;\n // This should never happen. If it does, it's a bug from the service.\n if (!iat) {\n throw new AuthError({\n name: 'iatNotFoundException',\n message: 'iat not found in access token',\n });\n }\n const clockDrift = iat * 1000 - new Date().getTime();\n return {\n accessToken,\n idToken,\n clockDrift,\n refreshToken: refreshTokenString,\n username,\n };\n};\nconst refreshAuthTokens = deDupeAsyncFunction(refreshAuthTokensFunction);\n\nexport { refreshAuthTokens };\n//# sourceMappingURL=refreshAuthTokens.mjs.map\n","import { Hub } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, isTokenExpired, AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass TokenOrchestrator {\n constructor() {\n this.waitForInflightOAuth = async () => {\n // no-op\n };\n }\n setAuthConfig(authConfig) {\n this.authConfig = authConfig;\n }\n setTokenRefresher(tokenRefresher) {\n this.tokenRefresher = tokenRefresher;\n }\n setAuthTokenStore(tokenStore) {\n this.tokenStore = tokenStore;\n }\n setWaitForInflightOAuth(waitForInflightOAuth) {\n this.waitForInflightOAuth = waitForInflightOAuth;\n }\n getTokenStore() {\n if (!this.tokenStore) {\n throw new AuthError({\n name: 'EmptyTokenStoreException',\n message: 'TokenStore not set',\n });\n }\n return this.tokenStore;\n }\n getTokenRefresher() {\n if (!this.tokenRefresher) {\n throw new AuthError({\n name: 'EmptyTokenRefresherException',\n message: 'TokenRefresher not set',\n });\n }\n return this.tokenRefresher;\n }\n async getTokens(options) {\n let tokens;\n try {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n }\n catch (_err) {\n // Token provider not configured\n return null;\n }\n await this.waitForInflightOAuth();\n tokens = await this.getTokenStore().loadTokens();\n const username = await this.getTokenStore().getLastAuthUser();\n if (tokens === null) {\n return null;\n }\n const idTokenExpired = !!tokens?.idToken &&\n isTokenExpired({\n expiresAt: (tokens.idToken?.payload?.exp ?? 0) * 1000,\n clockDrift: tokens.clockDrift ?? 0,\n });\n const accessTokenExpired = isTokenExpired({\n expiresAt: (tokens.accessToken?.payload?.exp ?? 0) * 1000,\n clockDrift: tokens.clockDrift ?? 0,\n });\n if (options?.forceRefresh || idTokenExpired || accessTokenExpired) {\n tokens = await this.refreshTokens({\n tokens,\n username,\n });\n if (tokens === null) {\n return null;\n }\n }\n return {\n accessToken: tokens?.accessToken,\n idToken: tokens?.idToken,\n signInDetails: tokens?.signInDetails,\n };\n }\n async refreshTokens({ tokens, username, }) {\n try {\n const newTokens = await this.getTokenRefresher()({\n tokens,\n authConfig: this.authConfig,\n username,\n });\n await this.setTokens({ tokens: newTokens });\n Hub.dispatch('auth', { event: 'tokenRefresh' }, 'Auth', AMPLIFY_SYMBOL);\n return newTokens;\n }\n catch (err) {\n return this.handleErrors(err);\n }\n }\n handleErrors(err) {\n assertServiceError(err);\n if (err.message !== 'Network error') {\n // TODO(v6): Check errors on client\n this.clearTokens();\n }\n Hub.dispatch('auth', {\n event: 'tokenRefresh_failure',\n data: { error: err },\n }, 'Auth', AMPLIFY_SYMBOL);\n if (err.name.startsWith('NotAuthorizedException')) {\n return null;\n }\n throw err;\n }\n async setTokens({ tokens }) {\n return this.getTokenStore().storeTokens(tokens);\n }\n async clearTokens() {\n return this.getTokenStore().clearTokens();\n }\n getDeviceMetadata(username) {\n return this.getTokenStore().getDeviceMetadata(username);\n }\n clearDeviceMetadata(username) {\n return this.getTokenStore().clearDeviceMetadata(username);\n }\n}\n\nexport { TokenOrchestrator };\n//# sourceMappingURL=TokenOrchestrator.mjs.map\n","import { defaultStorage } from '@aws-amplify/core';\nimport { refreshAuthTokens } from '../utils/refreshAuthTokens.mjs';\nimport { DefaultTokenStore } from './TokenStore.mjs';\nimport { TokenOrchestrator } from './TokenOrchestrator.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass CognitoUserPoolsTokenProvider {\n constructor() {\n this.authTokenStore = new DefaultTokenStore();\n this.authTokenStore.setKeyValueStorage(defaultStorage);\n this.tokenOrchestrator = new TokenOrchestrator();\n this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore);\n this.tokenOrchestrator.setTokenRefresher(refreshAuthTokens);\n }\n getTokens({ forceRefresh } = { forceRefresh: false }) {\n return this.tokenOrchestrator.getTokens({ forceRefresh });\n }\n setKeyValueStorage(keyValueStorage) {\n this.authTokenStore.setKeyValueStorage(keyValueStorage);\n }\n setWaitForInflightOAuth(waitForInflightOAuth) {\n this.tokenOrchestrator.setWaitForInflightOAuth(waitForInflightOAuth);\n }\n setAuthConfig(authConfig) {\n this.authTokenStore.setAuthConfig(authConfig);\n this.tokenOrchestrator.setAuthConfig(authConfig);\n }\n}\n\nexport { CognitoUserPoolsTokenProvider };\n//# sourceMappingURL=CognitoUserPoolsTokenProvider.mjs.map\n","import { CognitoUserPoolsTokenProvider } from './CognitoUserPoolsTokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The default provider for the JWT access token and ID token issued from the configured Cognito user pool. It manages\n * the refresh and storage of the tokens. It stores the tokens in `window.localStorage` if available, and falls back to\n * in-memory storage if not.\n */\nconst cognitoUserPoolsTokenProvider = new CognitoUserPoolsTokenProvider();\nconst { tokenOrchestrator } = cognitoUserPoolsTokenProvider;\n\nexport { cognitoUserPoolsTokenProvider, tokenOrchestrator };\n//# sourceMappingURL=tokenProvider.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getUserContextData({ username, userPoolId, userPoolClientId, }) {\n if (typeof window === 'undefined') {\n return undefined;\n }\n const amazonCognitoAdvancedSecurityData = window\n .AmazonCognitoAdvancedSecurityData;\n if (typeof amazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n const advancedSecurityData = amazonCognitoAdvancedSecurityData.getData(username, userPoolId, userPoolClientId);\n if (advancedSecurityData) {\n const userContextData = {\n EncodedData: advancedSecurityData,\n };\n return userContextData;\n }\n return {};\n}\n\nexport { getUserContextData };\n//# sourceMappingURL=userContextData.mjs.map\n","import { getAmplifyUserAgent, Category } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getAuthUserAgentValue = (action, customUserAgentDetails) => getAmplifyUserAgent({\n category: Category.Auth,\n action,\n ...customUserAgentDetails,\n});\n\nexport { getAuthUserAgentValue };\n//# sourceMappingURL=getAuthUserAgentValue.mjs.map\n","import { KeyValueStorage } from './KeyValueStorage.mjs';\nimport { getLocalStorageWithFallback } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nclass DefaultStorage extends KeyValueStorage {\n constructor() {\n super(getLocalStorageWithFallback());\n }\n}\n\nexport { DefaultStorage };\n//# sourceMappingURL=DefaultStorage.mjs.map\n","import { KeyValueStorage } from './KeyValueStorage.mjs';\nimport { getSessionStorageWithFallback } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nclass SessionStorage extends KeyValueStorage {\n constructor() {\n super(getSessionStorageWithFallback());\n }\n}\n\nexport { SessionStorage };\n//# sourceMappingURL=SessionStorage.mjs.map\n","import { DefaultStorage } from './DefaultStorage.mjs';\nimport { InMemoryStorage } from './InMemoryStorage.mjs';\nimport { KeyValueStorage } from './KeyValueStorage.mjs';\nimport { SessionStorage } from './SessionStorage.mjs';\nexport { CookieStorage } from './CookieStorage.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst defaultStorage = new DefaultStorage();\nconst sessionStorage = new SessionStorage();\nconst sharedInMemoryStorage = new KeyValueStorage(new InMemoryStorage());\n\nexport { defaultStorage, sessionStorage, sharedInMemoryStorage };\n//# sourceMappingURL=index.mjs.map\n"],"names":["clearCredentials","Amplify","d","Auth","completeOAuthSignOut","store","clearOAuthData","tokenProvider","C","clearTokens","Hub","Xb","dispatch","event","SQ","openAuthSession","url","window","location","href","replace","isSameOriginAndPathName","redirect","startsWith","String","origin","pathname","isTheSameDomain","includes","hostname","isHttp","isHttps","oAuthSignOutRedirect","authConfig","preferPrivateSession","utils","V0","loginWith","userPoolClientId","domain","redirectSignOut","oauth","signoutUri","getRedirectUrl","redirects","redirectUrlFromTheSameOrigin","find","redirectUrlFromDifferentOrigin","constants","VL","vC","Object","entries","client_id","logout_uri","encodeURIComponent","map","k","v","join","handleOAuthSignOut","cognitoConfig","isOAuthSignIn","loadOAuthSignIn","V5_HOSTED_UI_KEY","signInWithRedirectStore_name","DefaultOAuthStore","constructor","keyValueStorage","clearOAuthInflightData","FG","authKeys","createKeysForAuthStorage","Promise","all","removeItem","inflightOAuth","oauthPKCE","oauthState","oauthSignIn","loadOAuthState","getItem","storeOAuthState","state","setItem","loadPKCE","storePKCE","pkce","setAuthConfig","authConfigParam","loadOAuthInFlight","storeOAuthInFlight","inflight","isLegacyHostedUISignIn","split","storeOAuthSignIn","provider","identifier","TokenStore","_X","utils_types","Bx","logger","ConsoleLogger","signOut","input","hasOAuthConfig","getConfig","Cognito","global","globalSignOut","clientSignOut","err","oAuthStore","storage","Fm","type","AuthError","l","name","wW","message","authTokens","getTokenStore","loadTokens","XD","isSessionRevocable","accessToken","CognitoIdentityProvider","PX","region","CognitoIdentityProvider_utils","u","userPoolId","userAgentValue","getAuthUserAgentValue","W","types","g4","SignOut","ClientId","Token","refreshToken","debug","CA","oe","AccessToken","toString","token","payload","origin_jti","TokenProviderErrorCode","AuthTokenStorageKeys","idToken","oidcProvider","clockDrift","deviceKey","randomPasswordKey","deviceGroupKey","signInDetails","tokenValidationErrorMap","InvalidAuthTokens","recoverySuggestion","assert","createAssertionFunction","$","DefaultTokenStore","getKeyValueStorage","setKeyValueStorage","getAuthKeys","accessTokenString","xp","itString","undefined","clockDriftString","Number","parseInt","tokens","deviceMetadata","getDeviceMetadata","username","getLastAuthUser","JSON","parse","storeTokens","lastAuthUser","getLastAuthUserKey","randomPassword","stringify","clearDeviceMetadata","getAuthStorageKeys","keys","values","prefix","reduce","acc","authKey","inflightPromise","asyncFunction","refreshAuthTokens","refreshTokenString","AuthParameters","REFRESH_TOKEN","DEVICE_KEY","UserContextData","userContextData","AuthenticationResult","Cg","AuthFlow","IdToken","iat","Date","getTime","args","resolve","reject","then","result","catch","error","finally","TokenOrchestrator","waitForInflightOAuth","setTokenRefresher","tokenRefresher","setAuthTokenStore","tokenStore","setWaitForInflightOAuth","getTokenRefresher","getTokens","options","_err","idTokenExpired","p","expiresAt","exp","accessTokenExpired","forceRefresh","refreshTokens","newTokens","setTokens","handleErrors","assertServiceError","R","data","CognitoUserPoolsTokenProvider","authTokenStore","sI","tokenOrchestrator","cognitoUserPoolsTokenProvider","getUserContextData","amazonCognitoAdvancedSecurityData","AmazonCognitoAdvancedSecurityData","advancedSecurityData","getData","EncodedData","action","customUserAgentDetails","_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__","Zm","category","_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__","WD","DefaultStorage","KeyValueStorage","T","K","SessionStorage","defaultStorage","InMemoryStorage","w"],"sourceRoot":""}