@tern-secure/auth 1.1.0-canary.v20251030165007 → 1.1.0-canary.v20251125170702
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/dist/492_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/687_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/68_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/framework_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/ternsecure.browser.js +30 -0
- package/dist/ternsecure.css +2 -0
- package/dist/ternsecure.js +17 -0
- package/dist/ternsecure.mjs +17 -0
- package/dist/types/auth/AuthCookieManager.d.ts +17 -6
- package/dist/types/auth/cookies/authTime_cookie.d.ts +6 -0
- package/dist/types/index.browser.d.ts +1 -0
- package/dist/types/index.d.ts +3 -10
- package/dist/types/instance/c_coreApiClient.d.ts +2 -2
- package/dist/types/instance/constants.d.ts +3 -0
- package/dist/types/instance/coreApiClient.d.ts +0 -1
- package/dist/types/instance/events.d.ts +0 -1
- package/dist/types/instance/{TernAuth.d.ts → ternsecure.d.ts} +31 -19
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/resources/Base.d.ts +16 -3
- package/dist/types/resources/Error.d.ts +0 -1
- package/dist/types/resources/Session.d.ts +2 -2
- package/dist/types/resources/SignIn.d.ts +27 -10
- package/dist/types/resources/SignUp.d.ts +12 -10
- package/dist/types/resources/internal.d.ts +1 -2
- package/dist/types/ui/Renderer.d.ts +26 -0
- package/dist/types/ui/common/ProviderInitialIcon.d.ts +6 -0
- package/dist/types/ui/common/VerificationCodeCard.d.ts +12 -0
- package/dist/types/ui/common/VerificationLinkCard.d.ts +7 -0
- package/dist/types/ui/common/constants.d.ts +8 -0
- package/dist/types/ui/common/index.d.ts +3 -0
- package/dist/types/ui/components/sign-in/ResetPassword.d.ts +1 -0
- package/dist/types/ui/components/sign-in/ResetPasswordSuccess.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignIn.d.ts +4 -0
- package/dist/types/ui/components/sign-in/SignInEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-in/SignInFactorOne.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInFactorOneCodeForm.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePasswordCard.d.ts +6 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePhoneCodeCard.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInPassword.d.ts +8 -0
- package/dist/types/ui/components/sign-in/SignInSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInStart.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-in/index.d.ts +4 -0
- package/dist/types/ui/components/sign-up/SignUp.d.ts +8 -0
- package/dist/types/ui/components/sign-up/SignUpEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-up/SignUpSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpStart.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-up/index.d.ts +2 -0
- package/dist/types/ui/components/sign-up/util.d.ts +14 -0
- package/dist/types/ui/components/user-button/index.d.ts +1 -0
- package/dist/types/ui/components/user-button/userButton.d.ts +1 -0
- package/dist/types/ui/ctx/TernAuthContext.d.ts +4 -0
- package/dist/types/ui/ctx/TernAuthUIComponentCtx.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureContextWrapper.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureOptions.d.ts +10 -0
- package/dist/types/ui/ctx/components/SignIn.d.ts +21 -0
- package/dist/types/ui/ctx/components/SignUp.d.ts +14 -0
- package/dist/types/ui/ctx/components/UserButton.d.ts +10 -0
- package/dist/types/ui/ctx/components/index.d.ts +3 -0
- package/dist/types/ui/ctx/index.d.ts +4 -0
- package/dist/types/ui/ctx/utils.d.ts +3 -0
- package/dist/types/ui/customize/FieldControl.d.ts +15 -0
- package/dist/types/ui/customize/FieldLabelControl.d.ts +11 -0
- package/dist/types/ui/customize/Form.d.ts +36 -0
- package/dist/types/ui/elements/CodeControl.d.ts +47 -0
- package/dist/types/ui/elements/ErrorCard.d.ts +10 -0
- package/dist/types/ui/elements/LoadingCard.d.ts +1 -0
- package/dist/types/ui/elements/RouterLink.d.ts +42 -0
- package/dist/types/ui/elements/SocialButtons.d.ts +6 -0
- package/dist/types/ui/elements/TimerButton.d.ts +9 -0
- package/dist/types/ui/elements/alert.d.ts +8 -0
- package/dist/types/ui/elements/avatar.d.ts +6 -0
- package/dist/types/ui/elements/button.d.ts +10 -0
- package/dist/types/ui/elements/card.d.ts +9 -0
- package/dist/types/ui/elements/ctx/CardStateCtx.d.ts +26 -0
- package/dist/types/ui/elements/ctx/index.d.ts +1 -0
- package/dist/types/ui/elements/field.d.ts +24 -0
- package/dist/types/ui/elements/index.d.ts +16 -0
- package/dist/types/ui/elements/input.d.ts +3 -0
- package/dist/types/ui/elements/label.d.ts +4 -0
- package/dist/types/ui/elements/separator.d.ts +4 -0
- package/dist/types/ui/hooks/index.d.ts +6 -0
- package/dist/types/ui/hooks/useEmailLink.d.ts +11 -0
- package/dist/types/ui/hooks/useFetch.d.ts +44 -0
- package/dist/types/ui/hooks/useLoadingStatus.d.ts +14 -0
- package/dist/types/ui/hooks/useNavigateToFlowStart.d.ts +3 -0
- package/dist/types/ui/hooks/useSafeState.d.ts +9 -0
- package/dist/types/ui/hooks/useWindowEventListener.d.ts +3 -0
- package/dist/types/ui/icons/index.d.ts +13 -0
- package/dist/types/ui/lazyLoading/common.d.ts +2 -0
- package/dist/types/ui/lazyLoading/components.d.ts +11 -0
- package/dist/types/ui/lazyLoading/providersCtx.d.ts +26 -0
- package/dist/types/ui/portal/index.d.ts +12 -0
- package/dist/types/ui/router/BaseRouter.d.ts +21 -0
- package/dist/types/ui/router/HashRouter.d.ts +8 -0
- package/dist/types/ui/router/PathRouter.d.ts +8 -0
- package/dist/types/ui/router/Route.d.ts +19 -0
- package/dist/types/ui/router/RouterCtx.d.ts +32 -0
- package/dist/types/ui/router/Switch.d.ts +4 -0
- package/dist/types/ui/router/index.d.ts +7 -0
- package/dist/types/ui/router/newPaths.d.ts +1 -0
- package/dist/types/ui/router/pathToRegexp.d.ts +127 -0
- package/dist/types/ui/types.d.ts +18 -0
- package/dist/types/ui/utils/form.d.ts +19 -0
- package/dist/types/ui/utils/index.d.ts +1 -0
- package/dist/types/ui/utils/sleep.d.ts +1 -0
- package/dist/types/utils/construct.d.ts +3 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/normalizeRoutingOptions.d.ts +6 -0
- package/dist/types/utils/path.d.ts +0 -1
- package/dist/types/utils/querystring.d.ts +0 -1
- package/dist/types/utils/redirectUrls.d.ts +4 -9
- package/dist/types/utils/windowNavigate.d.ts +0 -1
- package/dist/ui-common_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/userbutton_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/vendors_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/package.json +64 -25
- package/dist/cjs/auth/AuthCookieManager.js +0 -100
- package/dist/cjs/auth/AuthCookieManager.js.map +0 -1
- package/dist/cjs/auth/cookies/session.js +0 -83
- package/dist/cjs/auth/cookies/session.js.map +0 -1
- package/dist/cjs/auth/request.js +0 -159
- package/dist/cjs/auth/request.js.map +0 -1
- package/dist/cjs/global.d.js +0 -2
- package/dist/cjs/global.d.js.map +0 -1
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/instance/TernAuth.js +0 -562
- package/dist/cjs/instance/TernAuth.js.map +0 -1
- package/dist/cjs/instance/TernAuthServer.js +0 -95
- package/dist/cjs/instance/TernAuthServer.js.map +0 -1
- package/dist/cjs/instance/c_coreApiClient.js +0 -264
- package/dist/cjs/instance/c_coreApiClient.js.map +0 -1
- package/dist/cjs/instance/coreApiClient.js +0 -255
- package/dist/cjs/instance/coreApiClient.js.map +0 -1
- package/dist/cjs/instance/events.js +0 -39
- package/dist/cjs/instance/events.js.map +0 -1
- package/dist/cjs/instance/jwtClient.js +0 -72
- package/dist/cjs/instance/jwtClient.js.map +0 -1
- package/dist/cjs/resources/Base.js +0 -137
- package/dist/cjs/resources/Base.js.map +0 -1
- package/dist/cjs/resources/Error.js +0 -31
- package/dist/cjs/resources/Error.js.map +0 -1
- package/dist/cjs/resources/Session.js +0 -105
- package/dist/cjs/resources/Session.js.map +0 -1
- package/dist/cjs/resources/SignIn.js +0 -256
- package/dist/cjs/resources/SignIn.js.map +0 -1
- package/dist/cjs/resources/SignUp.js +0 -72
- package/dist/cjs/resources/SignUp.js.map +0 -1
- package/dist/cjs/resources/Token.js +0 -32
- package/dist/cjs/resources/Token.js.map +0 -1
- package/dist/cjs/resources/UserData.js +0 -43
- package/dist/cjs/resources/UserData.js.map +0 -1
- package/dist/cjs/resources/cookie.js +0 -154
- package/dist/cjs/resources/cookie.js.map +0 -1
- package/dist/cjs/resources/index.js +0 -23
- package/dist/cjs/resources/index.js.map +0 -1
- package/dist/cjs/resources/internal.js +0 -35
- package/dist/cjs/resources/internal.js.map +0 -1
- package/dist/cjs/utils/construct.js +0 -253
- package/dist/cjs/utils/construct.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -29
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/jwt.js +0 -46
- package/dist/cjs/utils/jwt.js.map +0 -1
- package/dist/cjs/utils/mapDecode.js +0 -33
- package/dist/cjs/utils/mapDecode.js.map +0 -1
- package/dist/cjs/utils/path.js +0 -33
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/querystring.js +0 -70
- package/dist/cjs/utils/querystring.js.map +0 -1
- package/dist/cjs/utils/redirectUrls.js +0 -156
- package/dist/cjs/utils/redirectUrls.js.map +0 -1
- package/dist/cjs/utils/windowNavigate.js +0 -45
- package/dist/cjs/utils/windowNavigate.js.map +0 -1
- package/dist/esm/auth/AuthCookieManager.js +0 -76
- package/dist/esm/auth/AuthCookieManager.js.map +0 -1
- package/dist/esm/auth/cookies/session.js +0 -58
- package/dist/esm/auth/cookies/session.js.map +0 -1
- package/dist/esm/auth/request.js +0 -134
- package/dist/esm/auth/request.js.map +0 -1
- package/dist/esm/global.d.js +0 -1
- package/dist/esm/global.d.js.map +0 -1
- package/dist/esm/index.js +0 -16
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/instance/TernAuth.js +0 -548
- package/dist/esm/instance/TernAuth.js.map +0 -1
- package/dist/esm/instance/TernAuthServer.js +0 -73
- package/dist/esm/instance/TernAuthServer.js.map +0 -1
- package/dist/esm/instance/c_coreApiClient.js +0 -236
- package/dist/esm/instance/c_coreApiClient.js.map +0 -1
- package/dist/esm/instance/coreApiClient.js +0 -226
- package/dist/esm/instance/coreApiClient.js.map +0 -1
- package/dist/esm/instance/events.js +0 -14
- package/dist/esm/instance/events.js.map +0 -1
- package/dist/esm/instance/jwtClient.js +0 -47
- package/dist/esm/instance/jwtClient.js.map +0 -1
- package/dist/esm/resources/Base.js +0 -113
- package/dist/esm/resources/Base.js.map +0 -1
- package/dist/esm/resources/Error.js +0 -9
- package/dist/esm/resources/Error.js.map +0 -1
- package/dist/esm/resources/Session.js +0 -81
- package/dist/esm/resources/Session.js.map +0 -1
- package/dist/esm/resources/SignIn.js +0 -240
- package/dist/esm/resources/SignIn.js.map +0 -1
- package/dist/esm/resources/SignUp.js +0 -48
- package/dist/esm/resources/SignUp.js.map +0 -1
- package/dist/esm/resources/Token.js +0 -8
- package/dist/esm/resources/Token.js.map +0 -1
- package/dist/esm/resources/UserData.js +0 -19
- package/dist/esm/resources/UserData.js.map +0 -1
- package/dist/esm/resources/cookie.js +0 -130
- package/dist/esm/resources/cookie.js.map +0 -1
- package/dist/esm/resources/index.js +0 -2
- package/dist/esm/resources/index.js.map +0 -1
- package/dist/esm/resources/internal.js +0 -8
- package/dist/esm/resources/internal.js.map +0 -1
- package/dist/esm/utils/construct.js +0 -215
- package/dist/esm/utils/construct.js.map +0 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/jwt.js +0 -22
- package/dist/esm/utils/jwt.js.map +0 -1
- package/dist/esm/utils/mapDecode.js +0 -9
- package/dist/esm/utils/mapDecode.js.map +0 -1
- package/dist/esm/utils/path.js +0 -9
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/querystring.js +0 -45
- package/dist/esm/utils/querystring.js.map +0 -1
- package/dist/esm/utils/redirectUrls.js +0 -132
- package/dist/esm/utils/redirectUrls.js.map +0 -1
- package/dist/esm/utils/windowNavigate.js +0 -19
- package/dist/esm/utils/windowNavigate.js.map +0 -1
- package/dist/types/auth/AuthCookieManager.d.ts.map +0 -1
- package/dist/types/auth/cookies/session.d.ts +0 -8
- package/dist/types/auth/cookies/session.d.ts.map +0 -1
- package/dist/types/auth/request.d.ts +0 -49
- package/dist/types/auth/request.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/instance/TernAuth.d.ts.map +0 -1
- package/dist/types/instance/TernAuthServer.d.ts +0 -32
- package/dist/types/instance/TernAuthServer.d.ts.map +0 -1
- package/dist/types/instance/c_coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/events.d.ts.map +0 -1
- package/dist/types/instance/jwtClient.d.ts +0 -22
- package/dist/types/instance/jwtClient.d.ts.map +0 -1
- package/dist/types/resources/Base.d.ts.map +0 -1
- package/dist/types/resources/Error.d.ts.map +0 -1
- package/dist/types/resources/Session.d.ts.map +0 -1
- package/dist/types/resources/SignIn.d.ts.map +0 -1
- package/dist/types/resources/SignUp.d.ts.map +0 -1
- package/dist/types/resources/Token.d.ts +0 -5
- package/dist/types/resources/Token.d.ts.map +0 -1
- package/dist/types/resources/UserData.d.ts +0 -8
- package/dist/types/resources/UserData.d.ts.map +0 -1
- package/dist/types/resources/cookie.d.ts +0 -24
- package/dist/types/resources/cookie.d.ts.map +0 -1
- package/dist/types/resources/index.d.ts +0 -2
- package/dist/types/resources/index.d.ts.map +0 -1
- package/dist/types/resources/internal.d.ts.map +0 -1
- package/dist/types/utils/construct.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/jwt.d.ts +0 -12
- package/dist/types/utils/jwt.d.ts.map +0 -1
- package/dist/types/utils/mapDecode.d.ts +0 -4
- package/dist/types/utils/mapDecode.d.ts.map +0 -1
- package/dist/types/utils/path.d.ts.map +0 -1
- package/dist/types/utils/querystring.d.ts.map +0 -1
- package/dist/types/utils/redirectUrls.d.ts.map +0 -1
- package/dist/types/utils/windowNavigate.d.ts.map +0 -1
|
@@ -2,15 +2,29 @@ type CSRFToken = {
|
|
|
2
2
|
token: string | null;
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* AuthCookieManager class for managing authentication state and cookies
|
|
6
6
|
*/
|
|
7
7
|
export declare class AuthCookieManager {
|
|
8
8
|
private readonly csrfCookieHandler;
|
|
9
|
-
private
|
|
10
|
-
private idTokenCookie;
|
|
9
|
+
private readonly ternAutCookie;
|
|
11
10
|
constructor();
|
|
12
11
|
private generateCSRFToken;
|
|
13
12
|
private ensureCSRFToken;
|
|
13
|
+
/**
|
|
14
|
+
* Ensures the tern_aut cookie exists with value 0 if not already set.
|
|
15
|
+
* This is critical for SSR with browserCookie persistence so middleware
|
|
16
|
+
* doesn't throw errors when the cookie is missing.
|
|
17
|
+
*/
|
|
18
|
+
private ensureAuthTimeCookie;
|
|
19
|
+
/**
|
|
20
|
+
* Get auth_time value from cookie
|
|
21
|
+
*/
|
|
22
|
+
getAuthTime(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Set auth_time value in cookie
|
|
25
|
+
* Only accepts non-zero values from server
|
|
26
|
+
*/
|
|
27
|
+
setAuthTime(authTime: number): void;
|
|
14
28
|
/**
|
|
15
29
|
* Set CSRFcookie
|
|
16
30
|
*/
|
|
@@ -19,12 +33,9 @@ export declare class AuthCookieManager {
|
|
|
19
33
|
* Get CSRF token from cookies
|
|
20
34
|
*/
|
|
21
35
|
getCSRFToken(): string | undefined;
|
|
22
|
-
getSessionCookie(): string | undefined;
|
|
23
|
-
getIdTokenCookie(): string | undefined;
|
|
24
36
|
/**
|
|
25
37
|
* Clear all authentication cookies
|
|
26
38
|
*/
|
|
27
39
|
clearAuth(): void;
|
|
28
40
|
}
|
|
29
41
|
export {};
|
|
30
|
-
//# sourceMappingURL=AuthCookieManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export type { TernServerAuthOptions, AuthenticatedApp } from './instance/TernAuthServer';
|
|
5
|
-
export { CoreApiClient, coreApiClient } from './instance/coreApiClient';
|
|
6
|
-
export type { ApiResponse, ApiResponseJSON, RequestOptions, BeforeRequestHook, AfterResponseHook } from './instance/coreApiClient';
|
|
7
|
-
export { SignIn, TernSecureBase, buildURL } from './resources/internal';
|
|
8
|
-
export type { AuthErrorTree, TernSecureConfig, SignInFormValues, SignInProps, SignUpProps, SignInResponse, SignInForceRedirectUrl, SignUpForceRedirectUrl, SignInFallbackRedirectUrl, SignUpFallbackRedirectUrl, ResendEmailVerification, TernSecureUser, TernSecureState } from '@tern-secure/types';
|
|
9
|
-
export { RedirectUrls } from './utils/redirectUrls';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import 'regenerator-runtime/runtime';
|
|
2
|
+
import { TernSecureAuth } from './instance/ternsecure';
|
|
3
|
+
export { TernSecureAuth };
|
|
@@ -4,6 +4,7 @@ export type ApiRequestInit = RequestInit & {
|
|
|
4
4
|
path?: string;
|
|
5
5
|
search?: ConstructorParameters<typeof URLSearchParams>[0];
|
|
6
6
|
sessionId?: string;
|
|
7
|
+
pathPrefix?: string;
|
|
7
8
|
url?: URL;
|
|
8
9
|
};
|
|
9
10
|
export interface ApiResponseJSON<T> {
|
|
@@ -24,7 +25,7 @@ export interface ApiRequestOptions {
|
|
|
24
25
|
recoveryTimeoutMs?: number;
|
|
25
26
|
}
|
|
26
27
|
export interface ApiClientOptions {
|
|
27
|
-
|
|
28
|
+
authDomain?: string;
|
|
28
29
|
apiUrl?: string;
|
|
29
30
|
frontendApi?: string;
|
|
30
31
|
instanceType?: InstanceType;
|
|
@@ -55,4 +56,3 @@ export declare class HTTPError extends Error {
|
|
|
55
56
|
constructor(status: number, url: string, body?: any | undefined);
|
|
56
57
|
}
|
|
57
58
|
export declare function createCoreApiClient(clientOptions: ApiClientOptions): ApiClient;
|
|
58
|
-
//# sourceMappingURL=c_coreApiClient.d.ts.map
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import type { CreateActiveSession, InstanceType, ListenerCallback, NavigateOptions, SessionResource, SignedInSession, SignInRedirectOptions, SignInResource, SignOut, SignUpRedirectOptions, SignUpResource, TernAuthSDK, TernSecureAuth as TernSecureAuthInterface, TernSecureAuthOptions, TernSecureUser,
|
|
1
|
+
import type { CreateActiveSession, DomainOrProxyUrl, InstanceType, ListenerCallback, NavigateOptions, SessionResource, SignedInSession, SignInProps, SignInRedirectOptions, SignInResource, SignOut, SignUpProps, SignUpRedirectOptions, SignUpResource, TernAuthSDK, TernSecureAuth as TernSecureAuthInterface, TernSecureAuthOptions, TernSecureUser, UnsubscribeCallback } from '@tern-secure/types';
|
|
2
2
|
import type { Auth as TernAuth } from 'firebase/auth';
|
|
3
3
|
import { AuthCookieManager } from '../resources/internal';
|
|
4
|
+
import type { MountComponentRenderer } from '../ui/Renderer';
|
|
4
5
|
import { type ApiClient } from './c_coreApiClient';
|
|
5
6
|
export declare function inBrowser(): boolean;
|
|
6
7
|
export { TernAuth };
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
TernSecure?: TernSecureAuth;
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
apiUrl?: string;
|
|
13
|
+
authDomain: TernSecureAuthInterface['authDomain'];
|
|
14
|
+
frontEndDomain?: TernSecureAuthInterface['frontEndDomain'];
|
|
15
|
+
proxyUrl?: TernSecureAuthInterface['proxyUrl'];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
7
18
|
/**
|
|
8
19
|
* Firebase implementation of the TernSecureAuth interface
|
|
9
20
|
*/
|
|
@@ -11,6 +22,7 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
|
|
|
11
22
|
#private;
|
|
12
23
|
static version: string;
|
|
13
24
|
static sdkMetadata: TernAuthSDK;
|
|
25
|
+
static mountComponentRenderer?: MountComponentRenderer;
|
|
14
26
|
private static instance;
|
|
15
27
|
private _currentUser;
|
|
16
28
|
private signedInSession;
|
|
@@ -22,6 +34,9 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
|
|
|
22
34
|
error: Error | null;
|
|
23
35
|
user: TernSecureUser | null | undefined;
|
|
24
36
|
__internal_country?: string | null;
|
|
37
|
+
customDomain?: string | undefined;
|
|
38
|
+
isVisible: boolean;
|
|
39
|
+
currentView: 'signIn' | 'signUp' | null;
|
|
25
40
|
signIn: SignInResource | null | undefined;
|
|
26
41
|
signUp: SignUpResource | null | undefined;
|
|
27
42
|
session: SessionResource | null | undefined;
|
|
@@ -31,33 +46,30 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
|
|
|
31
46
|
set sdkMetadata(metadata: TernAuthSDK);
|
|
32
47
|
get sdkMetadata(): TernAuthSDK;
|
|
33
48
|
get requiresVerification(): boolean;
|
|
49
|
+
load: (options?: TernSecureAuthOptions) => Promise<void>;
|
|
50
|
+
__unstable__updateProps: (_props: any) => Promise<void> | undefined;
|
|
51
|
+
assertComponentControlsReady(controls: unknown): asserts controls is ReturnType<MountComponentRenderer>;
|
|
52
|
+
showSignIn(node: HTMLDivElement, props?: SignInProps): void;
|
|
53
|
+
hideSignIn(node: HTMLDivElement): void;
|
|
54
|
+
showSignUp(node: HTMLDivElement, props?: SignUpProps): void;
|
|
55
|
+
hideSignUp(node: HTMLDivElement): void;
|
|
56
|
+
showUserButton(node: HTMLDivElement): void;
|
|
57
|
+
hideUserButton(node: HTMLDivElement): void;
|
|
34
58
|
get apiUrl(): string;
|
|
35
|
-
get
|
|
59
|
+
get authDomain(): string;
|
|
36
60
|
get instanceType(): InstanceType | undefined;
|
|
37
|
-
constructor(options?:
|
|
61
|
+
constructor(apiUrl: string, options?: DomainOrProxyUrl);
|
|
38
62
|
getApiClient: () => ApiClient;
|
|
39
|
-
/**
|
|
40
|
-
* Get user data for the provided ID token via backend API
|
|
41
|
-
*/
|
|
42
|
-
getUserData(): Promise<TernSecureUserData | null>;
|
|
43
63
|
setLoading(isLoading: boolean): void;
|
|
44
64
|
authCookieManager(): AuthCookieManager | undefined;
|
|
45
65
|
_internal_getOption<K extends keyof TernSecureAuthOptions>(key: K): TernSecureAuthOptions[K];
|
|
46
66
|
_internal_getAllOptions(): Readonly<TernSecureAuthOptions>;
|
|
47
|
-
static getOrCreateInstance(options?:
|
|
67
|
+
static getOrCreateInstance(apiUrl: string, options?: DomainOrProxyUrl): TernSecureAuth;
|
|
48
68
|
static clearInstance(): void;
|
|
49
|
-
static initialize(options
|
|
69
|
+
static initialize(options?: TernSecureAuthOptions): TernSecureAuth;
|
|
50
70
|
initialize: (options?: TernSecureAuthOptions) => Promise<void>;
|
|
51
|
-
static create(options
|
|
71
|
+
static create(options?: TernSecureAuthOptions): TernSecureAuth;
|
|
52
72
|
private initializeFirebaseApp;
|
|
53
|
-
/**
|
|
54
|
-
* use when cookie are not httpOnly
|
|
55
|
-
*/
|
|
56
|
-
initClient: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated will be removed in future releases.
|
|
59
|
-
*/
|
|
60
|
-
initClientAuthRequest: () => void;
|
|
61
73
|
signOut: SignOut;
|
|
62
74
|
get currentSession(): SignedInSession | null;
|
|
63
75
|
private initAuthListener;
|
|
@@ -75,6 +87,7 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
|
|
|
75
87
|
createActiveSession: CreateActiveSession;
|
|
76
88
|
navigate: (to: string | undefined, options?: NavigateOptions) => Promise<unknown>;
|
|
77
89
|
constructUrlWithAuthRedirect: (to: string) => string;
|
|
90
|
+
constructAfterSignOutUrl: () => string;
|
|
78
91
|
redirectToSignIn: (options?: SignInRedirectOptions) => Promise<unknown>;
|
|
79
92
|
redirectToSignUp: (options?: SignUpRedirectOptions) => Promise<unknown>;
|
|
80
93
|
redirectAfterSignIn: () => Promise<unknown>;
|
|
@@ -83,4 +96,3 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
|
|
|
83
96
|
constructSignUpUrl: (options?: SignUpRedirectOptions) => string;
|
|
84
97
|
__internal_setCountry: (country: string | null) => void;
|
|
85
98
|
}
|
|
86
|
-
//# sourceMappingURL=TernAuth.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TernSecureResourceJSON } from '@tern-secure/types';
|
|
1
2
|
import type { ApiRequestInit, ApiResponseJSON } from '../instance/coreApiClient';
|
|
2
3
|
import type { AuthCookieManager, TernSecureAuth } from './internal';
|
|
3
4
|
export type HTTPMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
@@ -8,16 +9,27 @@ export type PostMutateParams = {
|
|
|
8
9
|
path?: string;
|
|
9
10
|
search?: ConstructorParameters<typeof URLSearchParams>[0];
|
|
10
11
|
};
|
|
12
|
+
export type BaseMutateParams = {
|
|
13
|
+
action?: string;
|
|
14
|
+
body?: any;
|
|
15
|
+
method?: HTTPMethod;
|
|
16
|
+
path?: string;
|
|
17
|
+
};
|
|
11
18
|
export declare abstract class TernSecureBase {
|
|
12
19
|
static ternsecure: TernSecureAuth;
|
|
20
|
+
id?: string;
|
|
21
|
+
pathRoot: string;
|
|
13
22
|
static get apiClient(): import("../instance/c_coreApiClient").ApiClient;
|
|
14
23
|
static get authCookieManager(): AuthCookieManager | undefined;
|
|
15
24
|
protected get authCookieManager(): AuthCookieManager | undefined;
|
|
25
|
+
isNew(): boolean;
|
|
16
26
|
/**
|
|
17
27
|
* Core method to fetch data from API endpoints using coreApiClient
|
|
18
28
|
* This method handles the complete request lifecycle including error handling
|
|
19
29
|
*/
|
|
20
|
-
protected static
|
|
30
|
+
protected static _baseFetchFromCoreApi<J extends TernSecureResourceJSON | null>(requestInit: ApiRequestInit): Promise<ApiResponseJSON<J> | null>;
|
|
31
|
+
protected path(action?: string): string;
|
|
32
|
+
protected abstract fromJSON(data: TernSecureResourceJSON | null): this;
|
|
21
33
|
/**
|
|
22
34
|
* Convenience method for making POST requests
|
|
23
35
|
*/
|
|
@@ -25,11 +37,12 @@ export declare abstract class TernSecureBase {
|
|
|
25
37
|
/**
|
|
26
38
|
* Instance method to fetch data from API endpoints
|
|
27
39
|
*/
|
|
28
|
-
protected
|
|
40
|
+
protected _fetchFromCoreApi<J extends TernSecureResourceJSON>(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
|
|
29
41
|
/**
|
|
30
42
|
* Instance method for making POST requests
|
|
31
43
|
*/
|
|
32
44
|
protected basePost(params: PostMutateParams): Promise<ApiResponseJSON<any> | null>;
|
|
45
|
+
protected _baseMutate<J extends TernSecureResourceJSON>(params?: BaseMutateParams): Promise<this>;
|
|
33
46
|
/**
|
|
34
47
|
* Instance method to make GET requests
|
|
35
48
|
* This is a convenience method that sets the HTTP method to GET
|
|
@@ -40,8 +53,8 @@ export declare abstract class TernSecureBase {
|
|
|
40
53
|
* This is designed to be used by child classes like SignIn
|
|
41
54
|
*/
|
|
42
55
|
protected _post(params: PostMutateParams): Promise<ApiResponseJSON<any> | null>;
|
|
56
|
+
protected _basePost<J extends TernSecureResourceJSON>(params?: BaseMutateParams): Promise<this>;
|
|
43
57
|
static makeApiRequest(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
|
|
44
58
|
protected makeApiRequest(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
|
|
45
59
|
private static shouldRethrowofflineNetworkError;
|
|
46
60
|
}
|
|
47
|
-
//# sourceMappingURL=Base.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdTokenResult, SessionJson, SessionResource, SessionStatus, TernSecureUser } from '@tern-secure/types';
|
|
1
|
+
import type { IdTokenResult, SessionJson, SessionResource, SessionStatus, TernSecureResourceJSON, TernSecureUser } from '@tern-secure/types';
|
|
2
2
|
import { TernSecureBase } from './Base';
|
|
3
3
|
/**
|
|
4
4
|
* Enhanced Session class that handles custom token authentication for client-server sync.
|
|
@@ -45,5 +45,5 @@ export declare class Session extends TernSecureBase implements SessionResource {
|
|
|
45
45
|
* Convert session to plain object for serialization
|
|
46
46
|
*/
|
|
47
47
|
toJSON(): SessionJson;
|
|
48
|
+
protected fromJSON(data: SessionJson | TernSecureResourceJSON | null): this;
|
|
48
49
|
}
|
|
49
|
-
//# sourceMappingURL=Session.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Auth, UserCredential } from 'firebase/auth';
|
|
1
|
+
import type { AttemptFirstFactorParams, SignInCreateParams, SignInFirstFactor, SignInJson, SignInPasswordParams, SignInPhoneParams, SignInResource, SignInResponse as SignInResponseFromTypes, SignInStatus, SignInVerificationResponse, SocialProviderOptions, TernSecureUser } from '@tern-secure/types';
|
|
2
|
+
import type { ApplicationVerifier, Auth, UserCredential } from 'firebase/auth';
|
|
3
3
|
import { TernSecureBase } from './Base';
|
|
4
4
|
type SignInResponse = SignInResponseFromTypes;
|
|
5
5
|
export type TernRequestInit = RequestInit;
|
|
@@ -13,18 +13,35 @@ export type SignInParams = {
|
|
|
13
13
|
export type SupportedProvider = 'google' | 'apple' | 'microsoft' | 'github' | 'twitter' | 'facebook' | string;
|
|
14
14
|
export declare class SignIn extends TernSecureBase implements SignInResource {
|
|
15
15
|
pathRoot: string;
|
|
16
|
+
pathSessionRoot: string;
|
|
17
|
+
id?: string;
|
|
16
18
|
status: SignInStatus | null;
|
|
19
|
+
supportedFirstFactors: SignInFirstFactor[] | null;
|
|
20
|
+
identifier: string | null;
|
|
17
21
|
private auth;
|
|
18
22
|
private csrfToken;
|
|
19
23
|
private _currentUser;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
private _confirmationResult;
|
|
25
|
+
constructor(data: (SignInJson | null) | undefined, auth: Auth, csrfToken: string | undefined);
|
|
26
|
+
get user(): TernSecureUser | null;
|
|
27
|
+
create: (params: SignInCreateParams) => Promise<this>;
|
|
28
|
+
attemptFirstFactor: (params: AttemptFirstFactorParams) => Promise<SignInResource>;
|
|
29
|
+
attemptPhoneNumberVerification: (params: {
|
|
30
|
+
code: string;
|
|
31
|
+
}) => Promise<SignInResource>;
|
|
32
|
+
signInWithCredential: (credential: UserCredential) => Promise<import("../instance/coreApiClient").ApiResponseJSON<any> | null>;
|
|
33
|
+
authenticateWithPassword: (params: SignInPasswordParams) => Promise<SignInResponse>;
|
|
34
|
+
createRecaptchaVerifier: (containerOrId: string | HTMLElement, parameters?: any) => ApplicationVerifier;
|
|
35
|
+
authenticateWithPhoneNumber: (params: SignInPhoneParams) => Promise<SignInResponse>;
|
|
36
|
+
withCredential: (params: SignInPasswordParams) => Promise<void>;
|
|
37
|
+
authenticateWithSocialProvider: (provider: SupportedProvider, options?: SocialProviderOptions) => Promise<SignInResponse>;
|
|
25
38
|
completeMfaSignIn: (_mfaToken: string, _mfaContext?: any) => Promise<SignInResponse>;
|
|
26
|
-
sendPasswordResetEmail: (email: string) => Promise<
|
|
27
|
-
resendEmailVerification
|
|
39
|
+
sendPasswordResetEmail: (email: string) => Promise<import("../instance/coreApiClient").ApiResponseJSON<any> | null>;
|
|
40
|
+
private resendEmailVerification;
|
|
41
|
+
attemptEmailVerification: (options?: {
|
|
42
|
+
url?: string;
|
|
43
|
+
handleCodeInApp?: boolean;
|
|
44
|
+
}) => Promise<SignInVerificationResponse>;
|
|
28
45
|
private getProviderConfig;
|
|
29
46
|
private authRedirectResult;
|
|
30
47
|
/**
|
|
@@ -50,6 +67,6 @@ export declare class SignIn extends TernSecureBase implements SignInResource {
|
|
|
50
67
|
private _signInWithRedirect;
|
|
51
68
|
private _signInWithPopUp;
|
|
52
69
|
checkRedirectResult(): Promise<SignInResponse | null>;
|
|
70
|
+
protected fromJSON(data: SignInJson | null): this;
|
|
53
71
|
}
|
|
54
72
|
export {};
|
|
55
|
-
//# sourceMappingURL=SignIn.d.ts.map
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SignUpFormValues, SignUpJson, SignUpResource, SignUpStatus, TernSecureUser, UnverifiedField } from '@tern-secure/types';
|
|
2
2
|
import type { Auth } from 'firebase/auth';
|
|
3
3
|
import { TernSecureBase } from './Base';
|
|
4
4
|
export declare class SignUp extends TernSecureBase implements SignUpResource {
|
|
5
5
|
status: SignUpStatus | null;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
email: string | null;
|
|
11
|
-
phoneNumber: string | null;
|
|
6
|
+
user: TernSecureUser | null;
|
|
7
|
+
unverifiedFields?: UnverifiedField[];
|
|
8
|
+
message?: string;
|
|
9
|
+
error?: any;
|
|
12
10
|
private auth;
|
|
13
|
-
constructor(auth: Auth);
|
|
14
|
-
withEmailAndPassword: (params:
|
|
11
|
+
constructor(data: (SignUpJson | null) | undefined, auth: Auth);
|
|
12
|
+
withEmailAndPassword: (params: SignUpFormValues) => Promise<SignUpResource>;
|
|
15
13
|
withSocialProvider(): Promise<void>;
|
|
14
|
+
attemptEmailVerification: (options?: {
|
|
15
|
+
url?: string;
|
|
16
|
+
handleCodeInApp?: boolean;
|
|
17
|
+
}) => Promise<SignUpResource>;
|
|
18
|
+
protected fromJSON(data: SignUpJson | null): this;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=SignUp.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { TernSecureAuth } from '../instance/
|
|
1
|
+
export type { TernSecureAuth } from '../instance/ternsecure';
|
|
2
2
|
export * from './Session';
|
|
3
3
|
export * from './SignUp';
|
|
4
4
|
export * from './SignIn';
|
|
@@ -6,4 +6,3 @@ export * from './Base';
|
|
|
6
6
|
export * from '../auth/AuthCookieManager';
|
|
7
7
|
export * from '../utils';
|
|
8
8
|
export * from './Error';
|
|
9
|
-
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TernSecureAuth, TernSecureAuthOptions } from '@tern-secure/types';
|
|
2
|
+
import type { TernSecureComponentName } from './lazyLoading/components';
|
|
3
|
+
import type { AvailableComponentProps } from './types';
|
|
4
|
+
export type TernComponentControls = {
|
|
5
|
+
mountComponent: (params: {
|
|
6
|
+
appearanceKey: string;
|
|
7
|
+
name: TernSecureComponentName;
|
|
8
|
+
node: HTMLDivElement;
|
|
9
|
+
props?: AvailableComponentProps;
|
|
10
|
+
}) => void;
|
|
11
|
+
unmountComponent: (params: {
|
|
12
|
+
node: HTMLDivElement;
|
|
13
|
+
}) => void;
|
|
14
|
+
updateProps: (params: {
|
|
15
|
+
appearanceKey?: string;
|
|
16
|
+
options?: TernSecureAuthOptions | undefined;
|
|
17
|
+
node: HTMLDivElement;
|
|
18
|
+
props?: unknown;
|
|
19
|
+
}) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const mountComponentRenderer: (ternsecure: TernSecureAuth, options: TernSecureAuthOptions) => {
|
|
22
|
+
ensureMounted: (opts?: {
|
|
23
|
+
preloadHint: TernSecureComponentName;
|
|
24
|
+
}) => Promise<TernComponentControls>;
|
|
25
|
+
};
|
|
26
|
+
export type MountComponentRenderer = typeof mountComponentRenderer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type VerificationCodeCardProps = {
|
|
4
|
+
cardTitle?: string;
|
|
5
|
+
cardDescription?: string;
|
|
6
|
+
inputLabel?: string;
|
|
7
|
+
submitButtonText?: string;
|
|
8
|
+
onCodeEntryFinishedAction: (code: string, resolve: () => Promise<void>, reject: (err: unknown) => Promise<void>) => void;
|
|
9
|
+
onResendCodeClicked?: React.MouseEventHandler;
|
|
10
|
+
onBackLinkClicked?: React.MouseEventHandler;
|
|
11
|
+
};
|
|
12
|
+
export declare const VerificationCodeCard: (props: PropsWithChildren<VerificationCodeCardProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Attribute } from '@tern-secure/types';
|
|
2
|
+
export type SignInStartIdentifier = 'email_address' | 'phone_number';
|
|
3
|
+
export declare const groupIdentifiers: (attributes: Attribute[]) => SignInStartIdentifier[];
|
|
4
|
+
export declare const getIdentifiers: (identifier: SignInStartIdentifier) => {
|
|
5
|
+
fieldName: string;
|
|
6
|
+
label: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PasswordReset: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PasswordResetSuccess(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignInFactorOne: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EmailCodeFactor, PhoneCodeFactor } from '@tern-secure/types';
|
|
2
|
+
import type { VerificationCodeCardProps } from '../../common/VerificationCodeCard';
|
|
3
|
+
export type SignInFactorOneCodeCard = Pick<VerificationCodeCardProps, 'onBackLinkClicked'> & {
|
|
4
|
+
factor: EmailCodeFactor | PhoneCodeFactor;
|
|
5
|
+
};
|
|
6
|
+
export type SignInFactorOneCodeFormProps = SignInFactorOneCodeCard;
|
|
7
|
+
export declare const SignInFactorOneCodeForm: (props: SignInFactorOneCodeFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type SignInFactorOnePasswordProps = {
|
|
2
|
+
signInWithPassword: (password: string) => Promise<void>;
|
|
3
|
+
onForgotPassword?: () => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const SignInFactorOnePasswordCard: (props: SignInFactorOnePasswordProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PhoneCodeFactor } from '@tern-secure/types';
|
|
2
|
+
import type { SignInFactorOneCodeCard } from './SignInFactorOneCodeForm';
|
|
3
|
+
type SignInFactorOnePhoneCodeCardProps = SignInFactorOneCodeCard & {
|
|
4
|
+
factor: PhoneCodeFactor;
|
|
5
|
+
};
|
|
6
|
+
export declare const SignInFactorOnePhoneCodeCard: (props: SignInFactorOnePhoneCodeCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SignInPasswordProps {
|
|
2
|
+
onError?: (error: Error) => void;
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
signInWithPassword?: (email: string, password: string) => Promise<void>;
|
|
5
|
+
onForgotPassword?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SignInPassword: (props: SignInPasswordProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignInSocialButtons: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SessionErrorCode = 'ENDPOINT_NOT_FOUND' | 'COOKIE_SET_FAILED' | 'API_REQUEST_FAILED' | 'NETWORK_ERROR' | 'UNAUTHORIZED' | 'UNKNOWN_ERROR';
|
|
2
|
+
export interface SessionError {
|
|
3
|
+
code: SessionErrorCode;
|
|
4
|
+
message: string;
|
|
5
|
+
original?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare const SignInStart: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignInVerifyEmail: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SignUpModalProps } from '@tern-secure/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { SignUpProps } from '../../types';
|
|
4
|
+
import { SignUpStart } from './SignUpStart';
|
|
5
|
+
import { SignUpVerifyEmail } from './SignUpVerifyEmail';
|
|
6
|
+
export declare const SignUp: React.ComponentType<SignUpProps>;
|
|
7
|
+
export declare const SignUpModal: (props: SignUpModalProps) => React.JSX.Element;
|
|
8
|
+
export { SignUpStart, SignUpVerifyEmail };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignUpSocialButtons: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignUpStart: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignUpVerifyEmail: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SignUpResource } from '@tern-secure/types';
|
|
2
|
+
type CompleteSignUpFlowProps = {
|
|
3
|
+
signUp: SignUpResource;
|
|
4
|
+
verifyEmailPath?: string;
|
|
5
|
+
verifyPhonePath?: string;
|
|
6
|
+
continuePath?: string;
|
|
7
|
+
navigate: (to: string) => Promise<unknown>;
|
|
8
|
+
handleComplete?: () => Promise<void>;
|
|
9
|
+
redirectUrl?: string;
|
|
10
|
+
redirectUrlComplete?: string;
|
|
11
|
+
oidcPrompt?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const completeSignUpFlow: ({ signUp, verifyEmailPath, navigate, handleComplete }: CompleteSignUpFlowProps) => Promise<unknown> | undefined;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './userButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UserButton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SignInResource, SignUpResource, TernSecureUser } from '@tern-secure/types';
|
|
2
|
+
export declare function useAuthSignIn(): SignInResource | undefined | null;
|
|
3
|
+
export declare function useAuthSignUp(): SignUpResource | undefined | null;
|
|
4
|
+
export declare function useAuthUser(): TernSecureUser | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AvailableComponentName, AvailableComponentProps } from '../types';
|
|
3
|
+
export declare function TernAuthUIComponentProvider({ componentName, props, children, }: {
|
|
4
|
+
componentName: AvailableComponentName;
|
|
5
|
+
props: AvailableComponentProps;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export * from './components';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TernSecureAuth } from '@tern-secure/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type TernSecureContextWrapperProps = {
|
|
4
|
+
ternsecure: TernSecureAuth;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function TernSecureContextWrapper(props: TernSecureContextWrapperProps): React.JSX.Element | null;
|
|
8
|
+
export {};
|