UNPKG

@aws-amplify/auth

Version:

Auth category of aws-amplify

1 lines • 1.35 kB
{"version":3,"file":"contextTokenOrchestrators.mjs","sources":["../../../../../src/providers/cognito/tokenProvider/contextTokenOrchestrators.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getContextTokenOrchestrator } from '@aws-amplify/core/internals/utils';\nimport { tokenOrchestrator as globalTokenOrchestrator } from './tokenProvider';\n/**\n * Resolves the write-capable token orchestrator for the given context.\n *\n * Returns the per-context orchestrator registered for the context's token\n * provider when one exists (the `createAmplifyContext()` path), and falls back\n * to the module-level singleton for the global `Amplify.configure()` path.\n *\n * This MUST be called at the entry point of a flow (e.g. `signInWithSRP`) so\n * every step downstream — including early device-metadata reads — uses the same\n * correctly configured orchestrator. Internal only.\n */\nexport const resolveTokenOrchestrator = (ctx) => getContextTokenOrchestrator(ctx?.libraryOptions?.Auth?.tokenProvider) ?? globalTokenOrchestrator;\n"],"names":["globalTokenOrchestrator"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,wBAAwB,GAAG,CAAC,GAAG,KAAK,2BAA2B,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,CAAC,IAAIA;;;;"}