UNPKG

@aws-amplify/auth

Version:
1 lines 1.3 kB
{"version":3,"file":"cancelOAuthFlow.mjs","sources":["../../../../../../src/providers/cognito/utils/oauth/cancelOAuthFlow.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createOAuthError } from './createOAuthError';\nimport { handleFailure } from './handleFailure';\nexport const listenForOAuthFlowCancellation = (store) => {\n async function handleCancelOAuthFlow(event) {\n const isBfcache = event.persisted;\n if (isBfcache && (await store.loadOAuthInFlight())) {\n const error = createOAuthError('User cancelled OAuth flow.');\n await handleFailure(error);\n }\n window.removeEventListener('pageshow', handleCancelOAuthFlow);\n }\n window.addEventListener('pageshow', handleCancelOAuthFlow);\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,8BAA8B,GAAG,CAAC,KAAK,KAAK;AACzD,IAAI,eAAe,qBAAqB,CAAC,KAAK,EAAE;AAChD,QAAQ,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS;AACzC,QAAQ,IAAI,SAAS,KAAK,MAAM,KAAK,CAAC,iBAAiB,EAAE,CAAC,EAAE;AAC5D,YAAY,MAAM,KAAK,GAAG,gBAAgB,CAAC,4BAA4B,CAAC;AACxE,YAAY,MAAM,aAAa,CAAC,KAAK,CAAC;AACtC,QAAQ;AACR,QAAQ,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,CAAC;AACrE,IAAI;AACJ,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,qBAAqB,CAAC;AAC9D;;;;"}