UNPKG

@aws-amplify/auth

Version:
1 lines 1.19 kB
{"version":3,"file":"openAuthSession.native.mjs","sources":["../../../src/utils/openAuthSession.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { loadAmplifyWebBrowser } from '@aws-amplify/react-native';\nexport const openAuthSession = async (url, redirectUrls, prefersEphemeralSession) => {\n try {\n const redirectUrl = await loadAmplifyWebBrowser().openAuthSessionAsync(url, redirectUrls, prefersEphemeralSession);\n if (!redirectUrl) {\n return { type: 'canceled' };\n }\n return { type: 'success', url: redirectUrl };\n }\n catch (error) {\n return { type: 'error', error };\n }\n};\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,eAAe,GAAG,OAAO,GAAG,EAAE,YAAY,EAAE,uBAAuB,KAAK;AACrF,IAAI,IAAI;AACR,QAAQ,MAAM,WAAW,GAAG,MAAM,qBAAqB,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,uBAAuB,CAAC;AAC1H,QAAQ,IAAI,CAAC,WAAW,EAAE;AAC1B,YAAY,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE;AACvC;AACA,QAAQ,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE;AACpD;AACA,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;AACvC;AACA;;;;"}