@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 1.42 kB
Source Map (JSON)
{"version":3,"file":"clearCredentials.mjs","sources":["../../../../src/singleton/apis/clearCredentials.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { resolveCtxArgs } from '../../context/resolveCtxArgs';\nimport { isUnconfiguredNoCtxCall } from './isUnconfiguredNoCtxCall';\nexport function clearCredentials(...args) {\n // Back-compat: before the context migration, `clearCredentials()` on an\n // unconfigured Amplify resolved harmlessly (the unconfigured `AuthClass`\n // optional-chains its missing credentials provider) rather than throwing.\n // Preserve that for the no-context form; the typed guards in\n // `resolveCtxArgs` still apply to explicit / mis-ordered context arguments.\n if (isUnconfiguredNoCtxCall(args)) {\n return Promise.resolve();\n }\n // `resolveCtxArgs` handles the global-context fallback plus the\n // mis-ordered / undefined-context guards used across all category APIs.\n const [ctx] = resolveCtxArgs(args);\n return ctx.clearCredentials();\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGO,SAAS,gBAAgB,CAAC,GAAG,IAAI,EAAE;AAC1C;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE;AACvC,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ;AACA;AACA,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC;AACtC,IAAI,OAAO,GAAG,CAAC,gBAAgB,EAAE;AACjC;;;;"}