UNPKG

@aws-amplify/auth

Version:

Auth category of aws-amplify

1 lines • 1.42 kB
{"version":3,"file":"completeOAuthSignOut.mjs","sources":["../../../../../../src/providers/cognito/utils/oauth/completeOAuthSignOut.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nexport const completeOAuthSignOut = async (store, tokenOrchestrator, clearCredentials) => {\n await store.clearOAuthData();\n // The orchestrator and the credential-clearing callback are resolved from the\n // caller's `AmplifyContext` in `signOut` and threaded down through\n // `handleOAuthSignOut`, so both target the context's own stores. This path is\n // only ever reached in-process from `signOut`; OAuth sign-IN completion after\n // a full-page redirect is a different flow (`completeOAuthFlow`, driven by\n // `enableOAuthListener`).\n tokenOrchestrator.clearTokens();\n await clearCredentials();\n Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,oBAAoB,GAAG,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,KAAK;AAC1F,IAAI,MAAM,KAAK,CAAC,cAAc,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iBAAiB,CAAC,WAAW,EAAE;AACnC,IAAI,MAAM,gBAAgB,EAAE;AAC5B,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,cAAc,CAAC;AACxE;;;;"}