@clerk/expo 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/cache/MemoryTokenCache.d.ts +3 -0
- package/dist/cache/MemoryTokenCache.d.ts.map +1 -0
- package/dist/cache/MemoryTokenCache.js +44 -0
- package/dist/cache/MemoryTokenCache.js.map +1 -0
- package/dist/cache/ResourceCache.d.ts +6 -0
- package/dist/cache/ResourceCache.d.ts.map +1 -0
- package/dist/cache/ResourceCache.js +84 -0
- package/dist/cache/ResourceCache.js.map +1 -0
- package/dist/cache/dummy-data/client-resource.d.ts +3 -0
- package/dist/cache/dummy-data/client-resource.d.ts.map +1 -0
- package/dist/cache/dummy-data/client-resource.js +157 -0
- package/dist/cache/dummy-data/client-resource.js.map +1 -0
- package/dist/cache/dummy-data/environment-resource.d.ts +3 -0
- package/dist/cache/dummy-data/environment-resource.d.ts.map +1 -0
- package/dist/cache/dummy-data/environment-resource.js +260 -0
- package/dist/cache/dummy-data/environment-resource.js.map +1 -0
- package/dist/cache/dummy-data/index.d.ts +3 -0
- package/dist/cache/dummy-data/index.d.ts.map +1 -0
- package/dist/cache/dummy-data/index.js +32 -0
- package/dist/cache/dummy-data/index.js.map +1 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +44 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/types.d.ts +18 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +17 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/components/controlComponents.d.ts +2 -0
- package/dist/components/controlComponents.d.ts.map +1 -0
- package/dist/components/controlComponents.js +37 -0
- package/dist/components/controlComponents.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +23 -0
- package/dist/components/index.js.map +1 -0
- package/dist/errorThrower.d.ts +3 -0
- package/dist/errorThrower.d.ts.map +1 -0
- package/dist/errorThrower.js +30 -0
- package/dist/errorThrower.js.map +1 -0
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +17 -0
- package/dist/experimental.js.map +1 -0
- package/dist/global.d.js +2 -0
- package/dist/global.d.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +56 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAuth.d.ts +3 -0
- package/dist/hooks/useAuth.d.ts.map +1 -0
- package/dist/hooks/useAuth.js +50 -0
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useOAuth.d.ts +25 -0
- package/dist/hooks/useOAuth.d.ts.map +1 -0
- package/dist/hooks/useOAuth.js +104 -0
- package/dist/hooks/useOAuth.js.map +1 -0
- package/dist/hooks/useSSO.d.ts +23 -0
- package/dist/hooks/useSSO.d.ts.map +1 -0
- package/dist/hooks/useSSO.js +105 -0
- package/dist/hooks/useSSO.js.map +1 -0
- package/dist/hooks/useSignInWithApple.d.ts +50 -0
- package/dist/hooks/useSignInWithApple.d.ts.map +1 -0
- package/dist/hooks/useSignInWithApple.ios.d.ts +51 -0
- package/dist/hooks/useSignInWithApple.ios.d.ts.map +1 -0
- package/dist/hooks/useSignInWithApple.ios.js +117 -0
- package/dist/hooks/useSignInWithApple.ios.js.map +1 -0
- package/dist/hooks/useSignInWithApple.js +39 -0
- package/dist/hooks/useSignInWithApple.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/legacy.d.ts +2 -0
- package/dist/legacy.d.ts.map +1 -0
- package/dist/legacy.js +31 -0
- package/dist/legacy.js.map +1 -0
- package/dist/local-credentials/index.d.ts +2 -0
- package/dist/local-credentials/index.d.ts.map +1 -0
- package/dist/local-credentials/index.js +29 -0
- package/dist/local-credentials/index.js.map +1 -0
- package/dist/local-credentials/useLocalCredentials/index.d.ts +2 -0
- package/dist/local-credentials/useLocalCredentials/index.d.ts.map +1 -0
- package/dist/local-credentials/useLocalCredentials/index.js +29 -0
- package/dist/local-credentials/useLocalCredentials/index.js.map +1 -0
- package/dist/local-credentials/useLocalCredentials/shared.d.ts +24 -0
- package/dist/local-credentials/useLocalCredentials/shared.d.ts.map +1 -0
- package/dist/local-credentials/useLocalCredentials/shared.js +37 -0
- package/dist/local-credentials/useLocalCredentials/shared.js.map +1 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.d.ts +7 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.d.ts.map +1 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.js +195 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.js.map +1 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.d.ts +3 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.d.ts.map +1 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.js +32 -0
- package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.js.map +1 -0
- package/dist/passkeys/index.d.ts +3 -0
- package/dist/passkeys/index.d.ts.map +1 -0
- package/dist/passkeys/index.js +29 -0
- package/dist/passkeys/index.js.map +1 -0
- package/dist/polyfills/base64Polyfill.d.ts +2 -0
- package/dist/polyfills/base64Polyfill.d.ts.map +1 -0
- package/dist/polyfills/base64Polyfill.js +10 -0
- package/dist/polyfills/base64Polyfill.js.map +1 -0
- package/dist/polyfills/index.d.ts +3 -0
- package/dist/polyfills/index.d.ts.map +1 -0
- package/dist/polyfills/index.js +4 -0
- package/dist/polyfills/index.js.map +1 -0
- package/dist/provider/ClerkProvider.d.ts +32 -0
- package/dist/provider/ClerkProvider.d.ts.map +1 -0
- package/dist/provider/ClerkProvider.js +85 -0
- package/dist/provider/ClerkProvider.js.map +1 -0
- package/dist/provider/singleton/createClerkInstance.d.ts +9 -0
- package/dist/provider/singleton/createClerkInstance.d.ts.map +1 -0
- package/dist/provider/singleton/createClerkInstance.js +167 -0
- package/dist/provider/singleton/createClerkInstance.js.map +1 -0
- package/dist/provider/singleton/index.d.ts +2 -0
- package/dist/provider/singleton/index.d.ts.map +1 -0
- package/dist/provider/singleton/index.js +23 -0
- package/dist/provider/singleton/index.js.map +1 -0
- package/dist/provider/singleton/singleton.d.ts +25 -0
- package/dist/provider/singleton/singleton.d.ts.map +1 -0
- package/dist/provider/singleton/singleton.js +34 -0
- package/dist/provider/singleton/singleton.js.map +1 -0
- package/dist/provider/singleton/singleton.web.d.ts +11 -0
- package/dist/provider/singleton/singleton.web.d.ts.map +1 -0
- package/dist/provider/singleton/singleton.web.js +36 -0
- package/dist/provider/singleton/singleton.web.js.map +1 -0
- package/dist/provider/singleton/types.d.ts +26 -0
- package/dist/provider/singleton/types.d.ts.map +1 -0
- package/dist/provider/singleton/types.js +17 -0
- package/dist/provider/singleton/types.js.map +1 -0
- package/dist/resource-cache/index.d.ts +2 -0
- package/dist/resource-cache/index.d.ts.map +1 -0
- package/dist/resource-cache/index.js +29 -0
- package/dist/resource-cache/index.js.map +1 -0
- package/dist/resource-cache/resource-cache.d.ts +17 -0
- package/dist/resource-cache/resource-cache.d.ts.map +1 -0
- package/dist/resource-cache/resource-cache.js +154 -0
- package/dist/resource-cache/resource-cache.js.map +1 -0
- package/dist/secure-store/index.d.ts +6 -0
- package/dist/secure-store/index.d.ts.map +1 -0
- package/dist/secure-store/index.js +30 -0
- package/dist/secure-store/index.js.map +1 -0
- package/dist/token-cache/index.d.ts +16 -0
- package/dist/token-cache/index.d.ts.map +1 -0
- package/dist/token-cache/index.js +66 -0
- package/dist/token-cache/index.js.map +1 -0
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +30 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/runtime.d.ts +10 -0
- package/dist/utils/runtime.d.ts.map +1 -0
- package/dist/utils/runtime.js +47 -0
- package/dist/utils/runtime.js.map +1 -0
- package/dist/web/index.d.ts +3 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +25 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/uiComponents.d.ts +18 -0
- package/dist/web/uiComponents.d.ts.map +1 -0
- package/dist/web/uiComponents.js +88 -0
- package/dist/web/uiComponents.js.map +1 -0
- package/package.json +138 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithApple.ios.ts"],"sourcesContent":["import { useSignIn, useSignUp } from '@clerk/react/legacy';\nimport type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';\n\nimport { errorThrower } from '../utils/errors';\n\nexport type StartAppleAuthenticationFlowParams = {\n unsafeMetadata?: SignUpUnsafeMetadata;\n};\n\nexport type StartAppleAuthenticationFlowReturnType = {\n createdSessionId: string | null;\n setActive?: SetActive;\n signIn?: SignInResource;\n signUp?: SignUpResource;\n};\n\n/**\n * Hook for native Apple Authentication on iOS using expo-apple-authentication.\n *\n * This hook provides a simplified way to authenticate users with their Apple ID\n * using the native iOS Sign in with Apple UI. The authentication flow automatically\n * handles the ID token exchange with Clerk's backend and manages the transfer flow\n * between sign-in and sign-up.\n *\n * @example\n * ```tsx\n * import { useSignInWithApple } from '@clerk/clerk-expo';\n * import { Button } from 'react-native';\n *\n * function AppleSignInButton() {\n * const { startAppleAuthenticationFlow } = useSignInWithApple();\n *\n * const onPress = async () => {\n * try {\n * const { createdSessionId, setActive } = await startAppleAuthenticationFlow();\n *\n * if (createdSessionId && setActive) {\n * await setActive({ session: createdSessionId });\n * }\n * } catch (err) {\n * console.error('Apple Authentication error:', err);\n * }\n * };\n *\n * return <Button title=\"Sign in with Apple\" onPress={onPress} />;\n * }\n * ```\n *\n * @requires expo-apple-authentication - Must be installed as a peer dependency\n * @platform iOS - This is the iOS-specific implementation\n *\n * @returns An object containing the `startAppleAuthenticationFlow` function\n */\nexport function useSignInWithApple() {\n const { signIn, setActive, isLoaded: isSignInLoaded } = useSignIn();\n const { signUp, isLoaded: isSignUpLoaded } = useSignUp();\n\n async function startAppleAuthenticationFlow(\n startAppleAuthenticationFlowParams?: StartAppleAuthenticationFlowParams,\n ): Promise<StartAppleAuthenticationFlowReturnType> {\n if (!isSignInLoaded || !isSignUpLoaded) {\n return {\n createdSessionId: null,\n signIn,\n signUp,\n setActive,\n };\n }\n\n // Dynamically import expo-apple-authentication only when needed\n let AppleAuthentication;\n let Crypto;\n\n try {\n [AppleAuthentication, Crypto] = await Promise.all([import('expo-apple-authentication'), import('expo-crypto')]);\n } catch {\n return errorThrower.throw(\n 'expo-apple-authentication is required to use Sign in with Apple. ' +\n 'Please install it by running: npx expo install expo-apple-authentication expo-crypto',\n );\n }\n\n // Check if Apple Authentication is available on the device\n const isAvailable = await AppleAuthentication.isAvailableAsync();\n if (!isAvailable) {\n return errorThrower.throw('Apple Authentication is not available on this device.');\n }\n\n try {\n // Generate a cryptographically secure nonce for the Apple Sign-In request (required by Clerk)\n const nonce = Crypto.randomUUID();\n\n // Request Apple authentication with requested scopes\n const credential = await AppleAuthentication.signInAsync({\n requestedScopes: [\n AppleAuthentication.AppleAuthenticationScope.FULL_NAME,\n AppleAuthentication.AppleAuthenticationScope.EMAIL,\n ],\n nonce,\n });\n\n // Extract the identity token from the credential\n const { identityToken } = credential;\n\n if (!identityToken) {\n return errorThrower.throw('No identity token received from Apple Sign-In.');\n }\n\n // Create a SignIn with the Apple ID token strategy\n await signIn.create({\n strategy: 'oauth_token_apple',\n token: identityToken,\n });\n\n // Check if we need to transfer to SignUp (user doesn't exist yet)\n const userNeedsToBeCreated = signIn.firstFactorVerification.status === 'transferable';\n\n if (userNeedsToBeCreated) {\n // User doesn't exist - create a new SignUp with transfer\n await signUp.create({\n transfer: true,\n unsafeMetadata: startAppleAuthenticationFlowParams?.unsafeMetadata,\n });\n\n return {\n createdSessionId: signUp.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // User exists - return the SignIn session\n return {\n createdSessionId: signIn.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n } catch (error: unknown) {\n // Handle Apple Authentication errors\n if (error && typeof error === 'object' && 'code' in error && error.code === 'ERR_REQUEST_CANCELED') {\n // User canceled the sign-in flow\n return {\n createdSessionId: null,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // Re-throw other errors\n throw error;\n }\n }\n\n return {\n startAppleAuthenticationFlow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAqC;AAGrC,oBAA6B;AAkDtB,SAAS,qBAAqB;AACnC,QAAM,EAAE,QAAQ,WAAW,UAAU,eAAe,QAAI,yBAAU;AAClE,QAAM,EAAE,QAAQ,UAAU,eAAe,QAAI,yBAAU;AAEvD,iBAAe,6BACb,oCACiD;AACjD,QAAI,CAAC,kBAAkB,CAAC,gBAAgB;AACtC,aAAO;AAAA,QACL,kBAAkB;AAAA,QAClB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAGA,QAAI;AACJ,QAAI;AAEJ,QAAI;AACF,OAAC,qBAAqB,MAAM,IAAI,MAAM,QAAQ,IAAI,CAAC,OAAO,2BAA2B,GAAG,OAAO,aAAa,CAAC,CAAC;AAAA,IAChH,QAAQ;AACN,aAAO,2BAAa;AAAA,QAClB;AAAA,MAEF;AAAA,IACF;AAGA,UAAM,cAAc,MAAM,oBAAoB,iBAAiB;AAC/D,QAAI,CAAC,aAAa;AAChB,aAAO,2BAAa,MAAM,uDAAuD;AAAA,IACnF;AAEA,QAAI;AAEF,YAAM,QAAQ,OAAO,WAAW;AAGhC,YAAM,aAAa,MAAM,oBAAoB,YAAY;AAAA,QACvD,iBAAiB;AAAA,UACf,oBAAoB,yBAAyB;AAAA,UAC7C,oBAAoB,yBAAyB;AAAA,QAC/C;AAAA,QACA;AAAA,MACF,CAAC;AAGD,YAAM,EAAE,cAAc,IAAI;AAE1B,UAAI,CAAC,eAAe;AAClB,eAAO,2BAAa,MAAM,gDAAgD;AAAA,MAC5E;AAGA,YAAM,OAAO,OAAO;AAAA,QAClB,UAAU;AAAA,QACV,OAAO;AAAA,MACT,CAAC;AAGD,YAAM,uBAAuB,OAAO,wBAAwB,WAAW;AAEvE,UAAI,sBAAsB;AAExB,cAAM,OAAO,OAAO;AAAA,UAClB,UAAU;AAAA,UACV,gBAAgB,yFAAoC;AAAA,QACtD,CAAC;AAED,eAAO;AAAA,UACL,kBAAkB,OAAO;AAAA,UACzB;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAGA,aAAO;AAAA,QACL,kBAAkB,OAAO;AAAA,QACzB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF,SAAS,OAAgB;AAEvB,UAAI,SAAS,OAAO,UAAU,YAAY,UAAU,SAAS,MAAM,SAAS,wBAAwB;AAElG,eAAO;AAAA,UACL,kBAAkB;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAGA,YAAM;AAAA,IACR;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useSignInWithApple_exports = {};
|
|
20
|
+
__export(useSignInWithApple_exports, {
|
|
21
|
+
useSignInWithApple: () => useSignInWithApple
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useSignInWithApple_exports);
|
|
24
|
+
var import_errors = require("../utils/errors");
|
|
25
|
+
function useSignInWithApple() {
|
|
26
|
+
function startAppleAuthenticationFlow(_startAppleAuthenticationFlowParams) {
|
|
27
|
+
return import_errors.errorThrower.throw(
|
|
28
|
+
'Apple Authentication via expo-apple-authentication is only available on iOS. For web and other platforms, please use the OAuth-based flow with useSSO and strategy: "oauth_apple".'
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
startAppleAuthenticationFlow
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
useSignInWithApple
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=useSignInWithApple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithApple.ts"],"sourcesContent":["import type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';\n\nimport { errorThrower } from '../utils/errors';\n\nexport type StartAppleAuthenticationFlowParams = {\n unsafeMetadata?: SignUpUnsafeMetadata;\n};\n\nexport type StartAppleAuthenticationFlowReturnType = {\n createdSessionId: string | null;\n setActive?: SetActive;\n signIn?: SignInResource;\n signUp?: SignUpResource;\n};\n\n/**\n * Stub for Apple Authentication hook on non-iOS platforms.\n *\n * Native Apple Authentication using expo-apple-authentication is only available on iOS.\n * For web platforms, use the OAuth-based Apple Sign-In flow instead via useSSO.\n *\n * @example\n * ```tsx\n * import { useSSO } from '@clerk/clerk-expo';\n * import { Button } from 'react-native';\n *\n * function AppleSignInButton() {\n * const { startSSOFlow } = useSSO();\n *\n * const onPress = async () => {\n * try {\n * const { createdSessionId, setActive } = await startSSOFlow({\n * strategy: 'oauth_apple'\n * });\n *\n * if (createdSessionId && setActive) {\n * await setActive({ session: createdSessionId });\n * }\n * } catch (err) {\n * console.error('Apple Authentication error:', err);\n * }\n * };\n *\n * return <Button title=\"Sign in with Apple\" onPress={onPress} />;\n * }\n * ```\n *\n * @platform iOS - This hook only works on iOS. On other platforms, it will throw an error.\n *\n * @returns An object containing the `startAppleAuthenticationFlow` function that throws an error\n */\nexport function useSignInWithApple(): {\n startAppleAuthenticationFlow: (\n startAppleAuthenticationFlowParams?: StartAppleAuthenticationFlowParams,\n ) => Promise<StartAppleAuthenticationFlowReturnType>;\n} {\n function startAppleAuthenticationFlow(\n _startAppleAuthenticationFlowParams?: StartAppleAuthenticationFlowParams,\n ): Promise<StartAppleAuthenticationFlowReturnType> {\n return errorThrower.throw(\n 'Apple Authentication via expo-apple-authentication is only available on iOS. ' +\n 'For web and other platforms, please use the OAuth-based flow with useSSO and strategy: \"oauth_apple\".',\n );\n }\n\n return {\n startAppleAuthenticationFlow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA6B;AAiDtB,SAAS,qBAId;AACA,WAAS,6BACP,qCACiD;AACjD,WAAO,2BAAa;AAAA,MAClB;AAAA,IAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError, isClerkRuntimeError, } from '@clerk/react/errors';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `getClerkInstance()` instead.
|
|
4
|
+
*/
|
|
5
|
+
export { clerk as Clerk } from './provider/singleton';
|
|
6
|
+
export { getClerkInstance } from './provider/singleton';
|
|
7
|
+
export * from './provider/ClerkProvider';
|
|
8
|
+
export * from './hooks';
|
|
9
|
+
export * from './components';
|
|
10
|
+
export type { TokenCache } from './cache/types';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAK7B,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
Clerk: () => import_singleton.clerk,
|
|
23
|
+
getClerkInstance: () => import_singleton2.getClerkInstance,
|
|
24
|
+
isClerkAPIResponseError: () => import_errors.isClerkAPIResponseError,
|
|
25
|
+
isClerkRuntimeError: () => import_errors.isClerkRuntimeError,
|
|
26
|
+
isEmailLinkError: () => import_errors.isEmailLinkError,
|
|
27
|
+
isKnownError: () => import_errors.isKnownError,
|
|
28
|
+
isMetamaskError: () => import_errors.isMetamaskError
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
|
+
var import_internal = require("@clerk/react/internal");
|
|
32
|
+
var import_errors = require("@clerk/react/errors");
|
|
33
|
+
var import_singleton = require("./provider/singleton");
|
|
34
|
+
var import_singleton2 = require("./provider/singleton");
|
|
35
|
+
__reExport(index_exports, require("./provider/ClerkProvider"), module.exports);
|
|
36
|
+
__reExport(index_exports, require("./hooks"), module.exports);
|
|
37
|
+
__reExport(index_exports, require("./components"), module.exports);
|
|
38
|
+
(0, import_internal.setErrorThrowerOptions)({ packageName: "@clerk/expo" });
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
Clerk,
|
|
42
|
+
getClerkInstance,
|
|
43
|
+
isClerkAPIResponseError,
|
|
44
|
+
isClerkRuntimeError,
|
|
45
|
+
isEmailLinkError,
|
|
46
|
+
isKnownError,
|
|
47
|
+
isMetamaskError,
|
|
48
|
+
...require("./provider/ClerkProvider"),
|
|
49
|
+
...require("./hooks"),
|
|
50
|
+
...require("./components")
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { setErrorThrowerOptions } from '@clerk/react/internal';\n\nexport {\n isClerkAPIResponseError,\n isEmailLinkError,\n isKnownError,\n isMetamaskError,\n isClerkRuntimeError,\n} from '@clerk/react/errors';\n\n/**\n * @deprecated Use `getClerkInstance()` instead.\n */\nexport { clerk as Clerk } from './provider/singleton';\nexport { getClerkInstance } from './provider/singleton';\n\nexport * from './provider/ClerkProvider';\nexport * from './hooks';\nexport * from './components';\n\n// Override Clerk React error thrower to show that errors come from @clerk/expo\nsetErrorThrowerOptions({ packageName: PACKAGE_NAME });\n\nexport type { TokenCache } from './cache/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAuC;AAEvC,oBAMO;AAKP,uBAA+B;AAC/B,IAAAA,oBAAiC;AAEjC,0BAAc,qCAhBd;AAiBA,0BAAc,oBAjBd;AAkBA,0BAAc,yBAlBd;AAAA,IAqBA,wCAAuB,EAAE,aAAa,cAAa,CAAC;","names":["import_singleton"]}
|
package/dist/legacy.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/legacy.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var legacy_exports = {};
|
|
20
|
+
__export(legacy_exports, {
|
|
21
|
+
useSignIn: () => import_legacy.useSignIn,
|
|
22
|
+
useSignUp: () => import_legacy.useSignUp
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(legacy_exports);
|
|
25
|
+
var import_legacy = require("@clerk/react/legacy");
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
useSignIn,
|
|
29
|
+
useSignUp
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/legacy.ts"],"sourcesContent":["export { useSignIn, useSignUp } from '@clerk/react/legacy';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAqC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-credentials/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var local_credentials_exports = {};
|
|
20
|
+
__export(local_credentials_exports, {
|
|
21
|
+
useLocalCredentials: () => import_useLocalCredentials.useLocalCredentials
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(local_credentials_exports);
|
|
24
|
+
var import_useLocalCredentials = require("./useLocalCredentials");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
useLocalCredentials
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/local-credentials/index.tsx"],"sourcesContent":["export { useLocalCredentials } from './useLocalCredentials';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/local-credentials/useLocalCredentials/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useLocalCredentials_exports = {};
|
|
20
|
+
__export(useLocalCredentials_exports, {
|
|
21
|
+
useLocalCredentials: () => import_useLocalCredentials.useLocalCredentials
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useLocalCredentials_exports);
|
|
24
|
+
var import_useLocalCredentials = require("./useLocalCredentials");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
useLocalCredentials
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/local-credentials/useLocalCredentials/index.tsx"],"sourcesContent":["export { useLocalCredentials } from './useLocalCredentials';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SignInResource } from '@clerk/shared/types';
|
|
2
|
+
type LocalCredentials = {
|
|
3
|
+
/**
|
|
4
|
+
* The identifier of the credentials to be stored on the device. It can be a username, email, phone number, etc.
|
|
5
|
+
*/
|
|
6
|
+
identifier?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The password for the identifier to be stored on the device. If an identifier already exists on the device passing only password would update the password for the stored identifier.
|
|
9
|
+
*/
|
|
10
|
+
password: string;
|
|
11
|
+
};
|
|
12
|
+
type BiometricType = 'fingerprint' | 'face-recognition';
|
|
13
|
+
type LocalCredentialsReturn = {
|
|
14
|
+
setCredentials: (creds: LocalCredentials) => Promise<void>;
|
|
15
|
+
hasCredentials: boolean;
|
|
16
|
+
userOwnsCredentials: boolean | null;
|
|
17
|
+
clearCredentials: () => Promise<void>;
|
|
18
|
+
authenticate: () => Promise<SignInResource>;
|
|
19
|
+
biometricType: BiometricType | null;
|
|
20
|
+
};
|
|
21
|
+
declare const LocalCredentialsInitValues: LocalCredentialsReturn;
|
|
22
|
+
export { LocalCredentialsInitValues };
|
|
23
|
+
export type { LocalCredentials, BiometricType, LocalCredentialsReturn };
|
|
24
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/local-credentials/useLocalCredentials/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,KAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAExD,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5C,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,0BAA0B,EAAE,sBAQjC,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var shared_exports = {};
|
|
20
|
+
__export(shared_exports, {
|
|
21
|
+
LocalCredentialsInitValues: () => LocalCredentialsInitValues
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(shared_exports);
|
|
24
|
+
const LocalCredentialsInitValues = {
|
|
25
|
+
setCredentials: () => Promise.resolve(),
|
|
26
|
+
hasCredentials: false,
|
|
27
|
+
userOwnsCredentials: null,
|
|
28
|
+
clearCredentials: () => Promise.resolve(),
|
|
29
|
+
// @ts-expect-error Initial value cannot return what the type expects
|
|
30
|
+
authenticate: () => Promise.resolve({}),
|
|
31
|
+
biometricType: null
|
|
32
|
+
};
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
LocalCredentialsInitValues
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/local-credentials/useLocalCredentials/shared.ts"],"sourcesContent":["import type { SignInResource } from '@clerk/shared/types';\n\ntype LocalCredentials = {\n /**\n * The identifier of the credentials to be stored on the device. It can be a username, email, phone number, etc.\n */\n identifier?: string;\n /**\n * The password for the identifier to be stored on the device. If an identifier already exists on the device passing only password would update the password for the stored identifier.\n */\n password: string;\n};\n\ntype BiometricType = 'fingerprint' | 'face-recognition';\n\ntype LocalCredentialsReturn = {\n setCredentials: (creds: LocalCredentials) => Promise<void>;\n hasCredentials: boolean;\n userOwnsCredentials: boolean | null;\n clearCredentials: () => Promise<void>;\n authenticate: () => Promise<SignInResource>;\n biometricType: BiometricType | null;\n};\n\nconst LocalCredentialsInitValues: LocalCredentialsReturn = {\n setCredentials: () => Promise.resolve(),\n hasCredentials: false,\n userOwnsCredentials: null,\n clearCredentials: () => Promise.resolve(),\n // @ts-expect-error Initial value cannot return what the type expects\n authenticate: () => Promise.resolve({}),\n biometricType: null,\n};\n\nexport { LocalCredentialsInitValues };\n\nexport type { LocalCredentials, BiometricType, LocalCredentialsReturn };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,MAAM,6BAAqD;AAAA,EACzD,gBAAgB,MAAM,QAAQ,QAAQ;AAAA,EACtC,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,kBAAkB,MAAM,QAAQ,QAAQ;AAAA;AAAA,EAExC,cAAc,MAAM,QAAQ,QAAQ,CAAC,CAAC;AAAA,EACtC,eAAe;AACjB;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LocalCredentialsReturn } from './shared';
|
|
2
|
+
/**
|
|
3
|
+
* Exposes utilities that allow for storing and accessing an identifier, and it's password securely on the device.
|
|
4
|
+
* In order to access the stored credentials, the end user will be prompted to verify themselves via biometrics.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useLocalCredentials: () => LocalCredentialsReturn;
|
|
7
|
+
//# sourceMappingURL=useLocalCredentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocalCredentials.d.ts","sourceRoot":"","sources":["../../../src/local-credentials/useLocalCredentials/useLocalCredentials.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAmC,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA8FxF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,sBAwGtC,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useLocalCredentials_exports = {};
|
|
20
|
+
__export(useLocalCredentials_exports, {
|
|
21
|
+
useLocalCredentials: () => useLocalCredentials
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useLocalCredentials_exports);
|
|
24
|
+
var import_react = require("@clerk/react");
|
|
25
|
+
var import_legacy = require("@clerk/react/legacy");
|
|
26
|
+
var import_expo_local_authentication = require("expo-local-authentication");
|
|
27
|
+
var import_expo_secure_store = require("expo-secure-store");
|
|
28
|
+
var import_react2 = require("react");
|
|
29
|
+
var import_utils = require("../../utils");
|
|
30
|
+
const useEnrolledBiometric = () => {
|
|
31
|
+
const [isEnrolled, setIsEnrolled] = (0, import_react2.useState)(false);
|
|
32
|
+
(0, import_react2.useEffect)(() => {
|
|
33
|
+
let ignore = false;
|
|
34
|
+
void (0, import_expo_local_authentication.isEnrolledAsync)().then((res) => {
|
|
35
|
+
if (ignore) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setIsEnrolled(res);
|
|
39
|
+
});
|
|
40
|
+
return () => {
|
|
41
|
+
ignore = true;
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return isEnrolled;
|
|
45
|
+
};
|
|
46
|
+
const useAuthenticationType = () => {
|
|
47
|
+
const [authenticationType, setAuthenticationType] = (0, import_react2.useState)(null);
|
|
48
|
+
(0, import_react2.useEffect)(() => {
|
|
49
|
+
let ignore = false;
|
|
50
|
+
void (0, import_expo_local_authentication.supportedAuthenticationTypesAsync)().then((numericTypes) => {
|
|
51
|
+
if (ignore) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (numericTypes.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (numericTypes.includes(import_expo_local_authentication.AuthenticationType.IRIS) || numericTypes.includes(import_expo_local_authentication.AuthenticationType.FACIAL_RECOGNITION)) {
|
|
58
|
+
setAuthenticationType("face-recognition");
|
|
59
|
+
} else {
|
|
60
|
+
setAuthenticationType("fingerprint");
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return () => {
|
|
64
|
+
ignore = true;
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
return authenticationType;
|
|
68
|
+
};
|
|
69
|
+
const useUserOwnsCredentials = ({ storeKey }) => {
|
|
70
|
+
const { user } = (0, import_react.useUser)();
|
|
71
|
+
const [userOwnsCredentials, setUserOwnsCredentials] = (0, import_react2.useState)(false);
|
|
72
|
+
const getUserCredentials = (storedIdentifier) => {
|
|
73
|
+
if (!user || !storedIdentifier) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const identifiers = [
|
|
77
|
+
user.emailAddresses.map((e) => e.emailAddress),
|
|
78
|
+
user.phoneNumbers.map((p) => p.phoneNumber)
|
|
79
|
+
].flat();
|
|
80
|
+
if (user.username) {
|
|
81
|
+
identifiers.push(user.username);
|
|
82
|
+
}
|
|
83
|
+
return identifiers.includes(storedIdentifier);
|
|
84
|
+
};
|
|
85
|
+
(0, import_react2.useEffect)(() => {
|
|
86
|
+
let ignore = false;
|
|
87
|
+
void (0, import_expo_secure_store.getItemAsync)(storeKey).catch(() => null).then((res) => {
|
|
88
|
+
if (ignore) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
setUserOwnsCredentials(getUserCredentials(res));
|
|
92
|
+
});
|
|
93
|
+
return () => {
|
|
94
|
+
ignore = true;
|
|
95
|
+
};
|
|
96
|
+
}, [storeKey, user]);
|
|
97
|
+
return [userOwnsCredentials, setUserOwnsCredentials];
|
|
98
|
+
};
|
|
99
|
+
const useLocalCredentials = () => {
|
|
100
|
+
const { isLoaded, signIn } = (0, import_legacy.useSignIn)();
|
|
101
|
+
const { publishableKey } = (0, import_react.useClerk)();
|
|
102
|
+
const key = `__clerk_local_auth_${publishableKey}_identifier`;
|
|
103
|
+
const pkey = `__clerk_local_auth_${publishableKey}_password`;
|
|
104
|
+
const [hasLocalAuthCredentials, setHasLocalAuthCredentials] = (0, import_react2.useState)(!!(0, import_expo_secure_store.getItem)(key));
|
|
105
|
+
const [userOwnsCredentials, setUserOwnsCredentials] = useUserOwnsCredentials({ storeKey: key });
|
|
106
|
+
const hasEnrolledBiometric = useEnrolledBiometric();
|
|
107
|
+
const authenticationType = useAuthenticationType();
|
|
108
|
+
const biometricType = hasEnrolledBiometric ? authenticationType : null;
|
|
109
|
+
const setCredentials = async (creds) => {
|
|
110
|
+
if (!await (0, import_expo_local_authentication.isEnrolledAsync)()) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (creds.identifier && !creds.password) {
|
|
114
|
+
return import_utils.errorThrower.throw(
|
|
115
|
+
`useLocalCredentials: setCredentials() A password is required when specifying an identifier.`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
if (creds.identifier) {
|
|
119
|
+
await (0, import_expo_secure_store.setItemAsync)(key, creds.identifier);
|
|
120
|
+
}
|
|
121
|
+
const storedIdentifier = await (0, import_expo_secure_store.getItemAsync)(key).catch(() => null);
|
|
122
|
+
if (!storedIdentifier) {
|
|
123
|
+
return import_utils.errorThrower.throw(
|
|
124
|
+
`useLocalCredentials: setCredentials() an identifier should already be set in order to update its password.`
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
setHasLocalAuthCredentials(true);
|
|
128
|
+
await (0, import_expo_secure_store.setItemAsync)(pkey, creds.password, {
|
|
129
|
+
keychainAccessible: import_expo_secure_store.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,
|
|
130
|
+
requireAuthentication: true
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const clearCredentials = async () => {
|
|
134
|
+
await Promise.all([(0, import_expo_secure_store.deleteItemAsync)(key), (0, import_expo_secure_store.deleteItemAsync)(pkey)]);
|
|
135
|
+
setHasLocalAuthCredentials(false);
|
|
136
|
+
setUserOwnsCredentials(false);
|
|
137
|
+
};
|
|
138
|
+
const authenticate = async () => {
|
|
139
|
+
if (!isLoaded) {
|
|
140
|
+
return import_utils.errorThrower.throw(
|
|
141
|
+
`useLocalCredentials: authenticate() Clerk has not loaded yet. Wait for clerk to load before calling this function`
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const identifier = await (0, import_expo_secure_store.getItemAsync)(key).catch(() => null);
|
|
145
|
+
if (!identifier) {
|
|
146
|
+
return import_utils.errorThrower.throw(`useLocalCredentials: authenticate() the identifier could not be found`);
|
|
147
|
+
}
|
|
148
|
+
const password = await (0, import_expo_secure_store.getItemAsync)(pkey).catch(() => null);
|
|
149
|
+
if (!password) {
|
|
150
|
+
return import_utils.errorThrower.throw(`useLocalCredentials: authenticate() cannot retrieve a password for ${identifier}`);
|
|
151
|
+
}
|
|
152
|
+
return signIn.create({
|
|
153
|
+
strategy: "password",
|
|
154
|
+
identifier,
|
|
155
|
+
password
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
/**
|
|
160
|
+
* Stores the provided credentials on the device if the device has enrolled biometrics.
|
|
161
|
+
* The end user needs to have a passcode set in order for the credentials to be stored, and those credentials will be removed if the passcode gets removed.
|
|
162
|
+
* @param credentials A [`LocalCredentials`](#localcredentials) object.
|
|
163
|
+
* @return A promise that will reject if value cannot be stored on the device.
|
|
164
|
+
*/
|
|
165
|
+
setCredentials,
|
|
166
|
+
/**
|
|
167
|
+
* A Boolean that indicates if there are any credentials stored on the device.
|
|
168
|
+
*/
|
|
169
|
+
hasCredentials: hasLocalAuthCredentials,
|
|
170
|
+
/**
|
|
171
|
+
* A Boolean that indicates if the stored credentials belong to the signed in uer. When there is no signed-in user the value will always be `false`.
|
|
172
|
+
*/
|
|
173
|
+
userOwnsCredentials,
|
|
174
|
+
/**
|
|
175
|
+
* Removes the stored credentials from the device.
|
|
176
|
+
* @return A promise that will reject if value cannot be deleted from the device.
|
|
177
|
+
*/
|
|
178
|
+
clearCredentials,
|
|
179
|
+
/**
|
|
180
|
+
* Attempts to read the stored credentials and creates a sign in attempt with the password strategy.
|
|
181
|
+
* @return A promise with a SignInResource if the stored credentials were accessed, otherwise the promise will reject.
|
|
182
|
+
*/
|
|
183
|
+
authenticate,
|
|
184
|
+
/**
|
|
185
|
+
* Indicates the supported enrolled biometric authenticator type.
|
|
186
|
+
* Can be `facial-recognition`, `fingerprint` or null.
|
|
187
|
+
*/
|
|
188
|
+
biometricType
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
useLocalCredentials
|
|
194
|
+
});
|
|
195
|
+
//# sourceMappingURL=useLocalCredentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/local-credentials/useLocalCredentials/useLocalCredentials.ts"],"sourcesContent":["import { useClerk, useUser } from '@clerk/react';\nimport { useSignIn } from '@clerk/react/legacy';\nimport type { SignInResource } from '@clerk/shared/types';\nimport { AuthenticationType, isEnrolledAsync, supportedAuthenticationTypesAsync } from 'expo-local-authentication';\nimport {\n deleteItemAsync,\n getItem,\n getItemAsync,\n setItemAsync,\n WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,\n} from 'expo-secure-store';\nimport { useEffect, useState } from 'react';\n\nimport { errorThrower } from '../../utils';\nimport type { BiometricType, LocalCredentials, LocalCredentialsReturn } from './shared';\n\nconst useEnrolledBiometric = () => {\n const [isEnrolled, setIsEnrolled] = useState(false);\n\n useEffect(() => {\n let ignore = false;\n\n void isEnrolledAsync().then(res => {\n if (ignore) {\n return;\n }\n setIsEnrolled(res);\n });\n\n return () => {\n ignore = true;\n };\n }, []);\n\n return isEnrolled;\n};\n\nconst useAuthenticationType = () => {\n const [authenticationType, setAuthenticationType] = useState<BiometricType | null>(null);\n\n useEffect(() => {\n let ignore = false;\n\n void supportedAuthenticationTypesAsync().then(numericTypes => {\n if (ignore) {\n return;\n }\n if (numericTypes.length === 0) {\n return;\n }\n\n if (\n numericTypes.includes(AuthenticationType.IRIS) ||\n numericTypes.includes(AuthenticationType.FACIAL_RECOGNITION)\n ) {\n setAuthenticationType('face-recognition');\n } else {\n setAuthenticationType('fingerprint');\n }\n });\n\n return () => {\n ignore = true;\n };\n }, []);\n\n return authenticationType;\n};\n\nconst useUserOwnsCredentials = ({ storeKey }: { storeKey: string }) => {\n const { user } = useUser();\n const [userOwnsCredentials, setUserOwnsCredentials] = useState(false);\n\n const getUserCredentials = (storedIdentifier: string | null): boolean => {\n if (!user || !storedIdentifier) {\n return false;\n }\n\n const identifiers = [\n user.emailAddresses.map(e => e.emailAddress),\n user.phoneNumbers.map(p => p.phoneNumber),\n ].flat();\n\n if (user.username) {\n identifiers.push(user.username);\n }\n return identifiers.includes(storedIdentifier);\n };\n\n useEffect(() => {\n let ignore = false;\n void getItemAsync(storeKey)\n .catch(() => null)\n .then(res => {\n if (ignore) {\n return;\n }\n setUserOwnsCredentials(getUserCredentials(res));\n });\n\n return () => {\n ignore = true;\n };\n }, [storeKey, user]);\n\n return [userOwnsCredentials, setUserOwnsCredentials] as const;\n};\n\n/**\n * Exposes utilities that allow for storing and accessing an identifier, and it's password securely on the device.\n * In order to access the stored credentials, the end user will be prompted to verify themselves via biometrics.\n */\nexport const useLocalCredentials = (): LocalCredentialsReturn => {\n const { isLoaded, signIn } = useSignIn();\n const { publishableKey } = useClerk();\n\n const key = `__clerk_local_auth_${publishableKey}_identifier`;\n const pkey = `__clerk_local_auth_${publishableKey}_password`;\n const [hasLocalAuthCredentials, setHasLocalAuthCredentials] = useState(!!getItem(key));\n const [userOwnsCredentials, setUserOwnsCredentials] = useUserOwnsCredentials({ storeKey: key });\n const hasEnrolledBiometric = useEnrolledBiometric();\n const authenticationType = useAuthenticationType();\n\n const biometricType = hasEnrolledBiometric ? authenticationType : null;\n\n const setCredentials = async (creds: LocalCredentials) => {\n if (!(await isEnrolledAsync())) {\n return;\n }\n\n if (creds.identifier && !creds.password) {\n return errorThrower.throw(\n `useLocalCredentials: setCredentials() A password is required when specifying an identifier.`,\n );\n }\n\n if (creds.identifier) {\n await setItemAsync(key, creds.identifier);\n }\n\n const storedIdentifier = await getItemAsync(key).catch(() => null);\n\n if (!storedIdentifier) {\n return errorThrower.throw(\n `useLocalCredentials: setCredentials() an identifier should already be set in order to update its password.`,\n );\n }\n\n setHasLocalAuthCredentials(true);\n await setItemAsync(pkey, creds.password, {\n keychainAccessible: WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,\n requireAuthentication: true,\n });\n };\n\n const clearCredentials = async () => {\n await Promise.all([deleteItemAsync(key), deleteItemAsync(pkey)]);\n setHasLocalAuthCredentials(false);\n setUserOwnsCredentials(false);\n };\n\n const authenticate = async (): Promise<SignInResource> => {\n if (!isLoaded) {\n return errorThrower.throw(\n `useLocalCredentials: authenticate() Clerk has not loaded yet. Wait for clerk to load before calling this function`,\n );\n }\n const identifier = await getItemAsync(key).catch(() => null);\n if (!identifier) {\n return errorThrower.throw(`useLocalCredentials: authenticate() the identifier could not be found`);\n }\n const password = await getItemAsync(pkey).catch(() => null);\n\n if (!password) {\n return errorThrower.throw(`useLocalCredentials: authenticate() cannot retrieve a password for ${identifier}`);\n }\n\n return signIn.create({\n strategy: 'password',\n identifier,\n password,\n });\n };\n\n return {\n /**\n * Stores the provided credentials on the device if the device has enrolled biometrics.\n * The end user needs to have a passcode set in order for the credentials to be stored, and those credentials will be removed if the passcode gets removed.\n * @param credentials A [`LocalCredentials`](#localcredentials) object.\n * @return A promise that will reject if value cannot be stored on the device.\n */\n setCredentials,\n /**\n * A Boolean that indicates if there are any credentials stored on the device.\n */\n hasCredentials: hasLocalAuthCredentials,\n /**\n * A Boolean that indicates if the stored credentials belong to the signed in uer. When there is no signed-in user the value will always be `false`.\n */\n userOwnsCredentials,\n /**\n * Removes the stored credentials from the device.\n * @return A promise that will reject if value cannot be deleted from the device.\n */\n clearCredentials,\n /**\n * Attempts to read the stored credentials and creates a sign in attempt with the password strategy.\n * @return A promise with a SignInResource if the stored credentials were accessed, otherwise the promise will reject.\n */\n authenticate,\n /**\n * Indicates the supported enrolled biometric authenticator type.\n * Can be `facial-recognition`, `fingerprint` or null.\n */\n biometricType,\n };\n};\n"],"mappings":"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","names":["import_react"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocalCredentials.web.d.ts","sourceRoot":"","sources":["../../../src/local-credentials/useLocalCredentials/useLocalCredentials.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGvD,eAAO,MAAM,mBAAmB,QAAO,sBAEtC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useLocalCredentials_web_exports = {};
|
|
20
|
+
__export(useLocalCredentials_web_exports, {
|
|
21
|
+
useLocalCredentials: () => useLocalCredentials
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useLocalCredentials_web_exports);
|
|
24
|
+
var import_shared = require("./shared");
|
|
25
|
+
const useLocalCredentials = () => {
|
|
26
|
+
return import_shared.LocalCredentialsInitValues;
|
|
27
|
+
};
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
useLocalCredentials
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=useLocalCredentials.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/local-credentials/useLocalCredentials/useLocalCredentials.web.ts"],"sourcesContent":["import type { LocalCredentialsReturn } from './shared';\nimport { LocalCredentialsInitValues } from './shared';\n\nexport const useLocalCredentials = (): LocalCredentialsReturn => {\n return LocalCredentialsInitValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2C;AAEpC,MAAM,sBAAsB,MAA8B;AAC/D,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/passkeys/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|