UNPKG

@aws-amplify/auth

Version:
1 lines 1.76 kB
{"version":3,"file":"handleOAuthSignOut.native.mjs","sources":["../../../../../../src/providers/cognito/utils/oauth/handleOAuthSignOut.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { completeOAuthSignOut } from './completeOAuthSignOut';\nimport { oAuthSignOutRedirect } from './oAuthSignOutRedirect';\nexport const handleOAuthSignOut = async (cognitoConfig, store, \n// No-op here as it's only used in the non-native implementation\ntokenOrchestrator, redirectUrl) => {\n const { isOAuthSignIn, preferPrivateSession } = await store.loadOAuthSignIn();\n if (isOAuthSignIn) {\n const result = await oAuthSignOutRedirect(cognitoConfig, preferPrivateSession, redirectUrl);\n // If this was a private session, clear data and tokens regardless of what happened with logout\n // endpoint. Otherwise, only do so if the logout endpoint was succesfully visited.\n const shouldCompleteSignOut = preferPrivateSession || result?.type === 'success';\n if (shouldCompleteSignOut) {\n await completeOAuthSignOut(store);\n }\n return result;\n }\n return completeOAuthSignOut(store);\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,kBAAkB,GAAG,OAAO,aAAa,EAAE,KAAK;AAC7D;AACA,iBAAiB,EAAE,WAAW,KAAK;AACnC,IAAI,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE;AACjF,IAAI,IAAI,aAAa,EAAE;AACvB,QAAQ,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,aAAa,EAAE,oBAAoB,EAAE,WAAW,CAAC;AACnG;AACA;AACA,QAAQ,MAAM,qBAAqB,GAAG,oBAAoB,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS;AACxF,QAAQ,IAAI,qBAAqB,EAAE;AACnC,YAAY,MAAM,oBAAoB,CAAC,KAAK,CAAC;AAC7C;AACA,QAAQ,OAAO,MAAM;AACrB;AACA,IAAI,OAAO,oBAAoB,CAAC,KAAK,CAAC;AACtC;;;;"}