UNPKG

@aws-amplify/auth

Version:
1 lines 1.06 kB
{"version":3,"file":"getCurrentUser.mjs","sources":["../../../../../../src/providers/cognito/apis/server/getCurrentUser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getAmplifyServerContext, } from '@aws-amplify/core/internals/adapter-core';\nimport { getCurrentUser as getCurrentUserInternal } from '../internal/getCurrentUser';\n/**\n * Gets the current user from the idToken.\n *\n * @returns GetCurrentUserOutput\n * @throws - {@link InitiateAuthException} - Thrown when the service fails to refresh the tokens.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nexport const getCurrentUser = async (contextSpec) => {\n return getCurrentUserInternal(getAmplifyServerContext(contextSpec).amplify);\n};\n"],"names":["getCurrentUserInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,OAAO,WAAW,KAAK;AACrD,IAAI,OAAOA,gBAAsB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;AAC/E;;;;"}