@atzentis/auth-react 0.0.14 → 0.0.15
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/index.d.ts +300 -29
- package/dist/index.js +1783 -301
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +48 -0
- package/dist/server.js +24 -0
- package/dist/server.js.map +1 -0
- package/package.json +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import * as _atzentis_auth_sdk from '@atzentis/auth-sdk';
|
|
5
|
-
import { AuthClient, User, Session, AuthError, LoginAlert, ITokenStorage, ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, LoginCredentials, UsernameLoginCredentials,
|
|
5
|
+
import { AuthClient, User, Session, AuthError, LoginAlert, ITokenStorage, ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, GetOAuthUrlRequest, LoginCredentials, UsernameLoginCredentials, RequestPasswordResetRequest, ResetPasswordRequest, SendMagicLinkRequest, SendVerificationEmailRequest, SignupData, VerifyEmailRequest, VerifyMagicLinkRequest, VerifyOAuthCodeRequest, Device, LoginEvent, ListLoginEventsRequest, Organization, CreateOrganizationRequest, UpdateOrganizationRequest, ListMembersRequest, UpdateMemberRequest, InviteMemberRequest, ListInvitationsRequest, AcceptInvitationRequest, DeclineInvitationRequest, DeviceSession, RevokeAllSessionsOptions, UserUpdate, ConnectOAuthRequest, OAuthProvider } from '@atzentis/auth-sdk';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -209,10 +209,50 @@ declare const authLocalization: {
|
|
|
209
209
|
RESET_PASSWORD_ACTION: string;
|
|
210
210
|
/** @default "Password reset successfully" */
|
|
211
211
|
RESET_PASSWORD_SUCCESS: string;
|
|
212
|
+
/** @default "Confirm new password" */
|
|
213
|
+
CONFIRM_NEW_PASSWORD: string;
|
|
212
214
|
/** @default "Set Password" */
|
|
213
215
|
SET_PASSWORD: string;
|
|
214
216
|
/** @default "Click the button to receive an email to set your password" */
|
|
215
217
|
SET_PASSWORD_DESCRIPTION: string;
|
|
218
|
+
/** @default "Check your email" */
|
|
219
|
+
CHECK_YOUR_EMAIL: string;
|
|
220
|
+
/** @default "Resend in {{seconds}}s" */
|
|
221
|
+
RESEND_IN: string;
|
|
222
|
+
/** @default "Email Verification" */
|
|
223
|
+
EMAIL_VERIFICATION: string;
|
|
224
|
+
/** @default "Verify your email address" */
|
|
225
|
+
EMAIL_VERIFICATION_DESCRIPTION: string;
|
|
226
|
+
/** @default "Email verified successfully" */
|
|
227
|
+
EMAIL_VERIFICATION_SUCCESS: string;
|
|
228
|
+
/** @default "Verifying your email..." */
|
|
229
|
+
EMAIL_VERIFICATION_CHECKING: string;
|
|
230
|
+
/** @default "Resend verification email" */
|
|
231
|
+
RESEND_VERIFICATION_EMAIL: string;
|
|
232
|
+
/** @default "Verification email sent" */
|
|
233
|
+
VERIFICATION_EMAIL_SENT: string;
|
|
234
|
+
/** @default "Email Code Verification" */
|
|
235
|
+
EMAIL_OTP: string;
|
|
236
|
+
/** @default "Enter your email to receive a verification code" */
|
|
237
|
+
EMAIL_OTP_DESCRIPTION: string;
|
|
238
|
+
/** @default "We sent a code to" */
|
|
239
|
+
EMAIL_OTP_SENT: string;
|
|
240
|
+
/** @default "Enter the 6-digit code" */
|
|
241
|
+
ENTER_VERIFICATION_CODE: string;
|
|
242
|
+
/** @default "Recover Account" */
|
|
243
|
+
RECOVER_ACCOUNT: string;
|
|
244
|
+
/** @default "Recover access to your account" */
|
|
245
|
+
RECOVER_ACCOUNT_DESCRIPTION: string;
|
|
246
|
+
/** @default "Select recovery method" */
|
|
247
|
+
SELECT_RECOVERY_METHOD: string;
|
|
248
|
+
/** @default "Reset via email link" */
|
|
249
|
+
RESET_VIA_EMAIL: string;
|
|
250
|
+
/** @default "Verify with email code" */
|
|
251
|
+
VERIFY_WITH_CODE: string;
|
|
252
|
+
/** @default "Verify via phone" */
|
|
253
|
+
VERIFY_VIA_PHONE: string;
|
|
254
|
+
/** @default "Step {{current}} of {{total}}" */
|
|
255
|
+
STEP_OF: string;
|
|
216
256
|
/** @default "Current Session" */
|
|
217
257
|
CURRENT_SESSION: string;
|
|
218
258
|
/** @default "Current device" */
|
|
@@ -337,6 +377,14 @@ declare const authLocalization: {
|
|
|
337
377
|
BACKUP_CODES: string;
|
|
338
378
|
/** @default "Save these codes in a secure place" */
|
|
339
379
|
BACKUP_CODES_DESCRIPTION: string;
|
|
380
|
+
/** @default "Enter your 6-digit code" */
|
|
381
|
+
ENTER_TOTP_CODE: string;
|
|
382
|
+
/** @default "Use backup code" */
|
|
383
|
+
USE_BACKUP_CODE: string;
|
|
384
|
+
/** @default "Use authenticator" */
|
|
385
|
+
USE_AUTHENTICATOR: string;
|
|
386
|
+
/** @default "Enter backup code" */
|
|
387
|
+
BACKUP_CODE_PLACEHOLDER: string;
|
|
340
388
|
/** @default "Passwords do not match" */
|
|
341
389
|
PASSWORDS_DO_NOT_MATCH: string;
|
|
342
390
|
/** @default "Password is required" */
|
|
@@ -461,24 +509,28 @@ declare function useAuth(): {
|
|
|
461
509
|
isAuthenticated: boolean;
|
|
462
510
|
isLoading: boolean;
|
|
463
511
|
error: _atzentis_auth_sdk.AuthError | null;
|
|
464
|
-
|
|
465
|
-
loginWithUsername: (credentials: UsernameLoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
466
|
-
signup: (data: SignupData) => Promise<_atzentis_auth_sdk.SignupResponse>;
|
|
467
|
-
logout: () => Promise<void>;
|
|
468
|
-
logoutAllDevices: () => Promise<void>;
|
|
469
|
-
getOAuthUrl: (config: GetOAuthUrlRequest) => string;
|
|
470
|
-
verifyOAuthCode: (request: VerifyOAuthCodeRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
471
|
-
sendMagicLink: (request: SendMagicLinkRequest) => Promise<void>;
|
|
472
|
-
verifyMagicLink: (request: VerifyMagicLinkRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
473
|
-
isUsernameAvailable: (username: string) => Promise<boolean>;
|
|
512
|
+
clearError: () => void;
|
|
474
513
|
getAccessToken: () => Promise<string | null>;
|
|
475
|
-
refreshToken: () => Promise<_atzentis_auth_sdk.RefreshTokenResponse>;
|
|
476
514
|
getAuthHeader: () => Promise<{
|
|
477
515
|
Authorization: string;
|
|
478
516
|
} | {
|
|
479
517
|
Authorization?: undefined;
|
|
480
518
|
}>;
|
|
481
|
-
|
|
519
|
+
getOAuthUrl: (config: GetOAuthUrlRequest) => string;
|
|
520
|
+
isUsernameAvailable: (username: string) => Promise<boolean>;
|
|
521
|
+
login: (credentials: LoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
522
|
+
loginWithUsername: (credentials: UsernameLoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
523
|
+
logout: () => Promise<void>;
|
|
524
|
+
logoutAllDevices: () => Promise<void>;
|
|
525
|
+
refreshToken: () => Promise<_atzentis_auth_sdk.RefreshTokenResponse>;
|
|
526
|
+
requestPasswordReset: (request: RequestPasswordResetRequest) => Promise<void>;
|
|
527
|
+
resetPassword: (request: ResetPasswordRequest) => Promise<_atzentis_auth_sdk.ResetPasswordResponse>;
|
|
528
|
+
sendMagicLink: (request: SendMagicLinkRequest) => Promise<void>;
|
|
529
|
+
sendVerificationEmail: (request: SendVerificationEmailRequest) => Promise<void>;
|
|
530
|
+
signup: (data: SignupData) => Promise<_atzentis_auth_sdk.SignupResponse>;
|
|
531
|
+
verifyEmail: (request: VerifyEmailRequest) => Promise<_atzentis_auth_sdk.VerifyEmailResponse>;
|
|
532
|
+
verifyMagicLink: (request: VerifyMagicLinkRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
533
|
+
verifyOAuthCode: (request: VerifyOAuthCodeRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
482
534
|
};
|
|
483
535
|
|
|
484
536
|
declare function useAuthContext(): AuthContextValue;
|
|
@@ -681,33 +733,148 @@ interface OrganizationMenuProps {
|
|
|
681
733
|
onCreateNew?: () => void;
|
|
682
734
|
className?: string;
|
|
683
735
|
}
|
|
736
|
+
interface ForgotPasswordFormProps {
|
|
737
|
+
redirectUrl: string;
|
|
738
|
+
onSuccess?: () => void;
|
|
739
|
+
onError?: (error: AuthError) => void;
|
|
740
|
+
onBackToLogin?: () => void;
|
|
741
|
+
resendCooldown?: number;
|
|
742
|
+
className?: string;
|
|
743
|
+
}
|
|
744
|
+
interface TwoFactorFormProps {
|
|
745
|
+
onVerify: (code: string) => void | Promise<void>;
|
|
746
|
+
onError?: (error: AuthError) => void;
|
|
747
|
+
autoSubmit?: boolean;
|
|
748
|
+
isLoading?: boolean;
|
|
749
|
+
className?: string;
|
|
750
|
+
}
|
|
751
|
+
interface EmailVerificationFormProps {
|
|
752
|
+
token?: string;
|
|
753
|
+
email?: string;
|
|
754
|
+
redirectUrl: string;
|
|
755
|
+
onSuccess?: (user: User) => void;
|
|
756
|
+
onError?: (error: AuthError) => void;
|
|
757
|
+
resendCooldown?: number;
|
|
758
|
+
className?: string;
|
|
759
|
+
}
|
|
760
|
+
interface EmailOTPFormProps {
|
|
761
|
+
redirectUrl: string;
|
|
762
|
+
onSuccess?: (user: User) => void;
|
|
763
|
+
onError?: (error: AuthError) => void;
|
|
764
|
+
resendCooldown?: number;
|
|
765
|
+
autoSubmit?: boolean;
|
|
766
|
+
className?: string;
|
|
767
|
+
}
|
|
768
|
+
interface ResetPasswordFormProps {
|
|
769
|
+
token: string;
|
|
770
|
+
onSuccess?: () => void;
|
|
771
|
+
onError?: (error: AuthError) => void;
|
|
772
|
+
className?: string;
|
|
773
|
+
}
|
|
774
|
+
interface RecoverAccountFormProps {
|
|
775
|
+
redirectUrl: string;
|
|
776
|
+
enablePhone?: boolean;
|
|
777
|
+
onSuccess?: () => void;
|
|
778
|
+
onError?: (error: AuthError) => void;
|
|
779
|
+
resendCooldown?: number;
|
|
780
|
+
className?: string;
|
|
781
|
+
}
|
|
684
782
|
interface LoadingBoundaryProps {
|
|
685
783
|
children: ReactNode;
|
|
686
784
|
spinner?: ReactNode;
|
|
687
785
|
delay?: number;
|
|
688
786
|
className?: string;
|
|
689
787
|
}
|
|
788
|
+
type AuthViewPath = "/sign-in" | "/sign-up" | "/forgot-password" | "/reset-password" | "/verify-email" | "/email-otp" | "/recover-account" | "/two-factor";
|
|
789
|
+
interface AuthViewProps {
|
|
790
|
+
pathname: string;
|
|
791
|
+
paths?: Partial<Record<AuthViewPath, string>>;
|
|
792
|
+
fallback?: ReactNode;
|
|
793
|
+
searchParams?: Record<string, string | undefined>;
|
|
794
|
+
getSearchParam?: (key: string) => string | undefined;
|
|
795
|
+
onSuccess?: (userOrVoid?: User) => void;
|
|
796
|
+
onError?: (error: AuthError) => void;
|
|
797
|
+
enablePhone?: boolean;
|
|
798
|
+
oauthProviders?: OAuthProvider[];
|
|
799
|
+
oauthRedirectUri?: string;
|
|
800
|
+
redirectUrl?: string;
|
|
801
|
+
className?: string;
|
|
802
|
+
}
|
|
690
803
|
|
|
691
804
|
declare function AccountSwitcher({ showAddAccount, onSwitch, onAddAccount, maxAccounts, className, }: AccountSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
692
805
|
|
|
693
806
|
declare function SessionGuard({ children, fallback, loadingFallback, freshRequired, freshThreshold, requiredRole, className, }: SessionGuardProps): react_jsx_runtime.JSX.Element;
|
|
694
807
|
|
|
695
|
-
|
|
808
|
+
/**
|
|
809
|
+
* AuthView — Pathname-based router for auth flows.
|
|
810
|
+
* Renders the appropriate auth form component based on the pathname prop.
|
|
811
|
+
*
|
|
812
|
+
* @example
|
|
813
|
+
* // Next.js App Router:
|
|
814
|
+
* import { AuthView } from "@atzentis/auth-react";
|
|
815
|
+
*
|
|
816
|
+
* export default function AuthPage({ params, searchParams }) {
|
|
817
|
+
* const pathname = `/${params.slug?.join("/") || ""}`;
|
|
818
|
+
* return <AuthView pathname={pathname} searchParams={searchParams} />;
|
|
819
|
+
* }
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* // Custom path mapping:
|
|
823
|
+
* <AuthView
|
|
824
|
+
* pathname="/login"
|
|
825
|
+
* paths={{ "/sign-in": "/login", "/sign-up": "/register" }}
|
|
826
|
+
* onSuccess={(user) => router.push("/dashboard")}
|
|
827
|
+
* />
|
|
828
|
+
*/
|
|
829
|
+
declare function AuthView({ pathname, paths, fallback, searchParams, getSearchParam, onSuccess, onError, enablePhone, oauthProviders, oauthRedirectUri, redirectUrl, className, }: AuthViewProps): react_jsx_runtime.JSX.Element;
|
|
696
830
|
|
|
697
|
-
|
|
831
|
+
/**
|
|
832
|
+
* Default path mapping for AuthView component.
|
|
833
|
+
* Maps logical auth flow paths to actual URL paths.
|
|
834
|
+
*
|
|
835
|
+
* @example
|
|
836
|
+
* // Use in Next.js App Router:
|
|
837
|
+
* <AuthView pathname={pathname} paths={authViewPaths} />
|
|
838
|
+
*
|
|
839
|
+
* // Override specific paths:
|
|
840
|
+
* <AuthView
|
|
841
|
+
* pathname={pathname}
|
|
842
|
+
* paths={{ ...authViewPaths, "/sign-in": "/login" }}
|
|
843
|
+
* />
|
|
844
|
+
*/
|
|
845
|
+
declare const authViewPaths: Record<AuthViewPath, string>;
|
|
698
846
|
|
|
699
|
-
declare function
|
|
847
|
+
declare function EmailOTPForm({ redirectUrl, onSuccess, onError, resendCooldown, autoSubmit, className, }: EmailOTPFormProps): react_jsx_runtime.JSX.Element;
|
|
848
|
+
|
|
849
|
+
declare function EmailVerificationForm({ token, email, redirectUrl, onSuccess, onError, resendCooldown, className, }: EmailVerificationFormProps): react_jsx_runtime.JSX.Element;
|
|
850
|
+
|
|
851
|
+
declare function ForgotPasswordForm({ redirectUrl, onSuccess, onError, onBackToLogin, resendCooldown, className, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
700
852
|
|
|
701
853
|
declare function LoginForm({ onSuccess, onError, enablePhone, enableForgotPassword, onForgotPasswordClick, className, ...oauthProps }: LoginFormProps): react_jsx_runtime.JSX.Element;
|
|
702
854
|
|
|
703
855
|
declare function MagicLinkForm({ redirectUrl, onSuccess, onError, className }: MagicLinkFormProps): react_jsx_runtime.JSX.Element;
|
|
704
856
|
|
|
705
|
-
declare function OAuthButton({ provider, redirectUri, state, variant, size, className, }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
706
|
-
|
|
707
857
|
declare function PhoneLoginForm({ onSuccess, onError, allowedCountryCodes, showPasswordFallback, className, }: PhoneLoginFormProps): react_jsx_runtime.JSX.Element;
|
|
708
858
|
|
|
859
|
+
declare function RecoverAccountForm({ redirectUrl, enablePhone, onSuccess, onError, resendCooldown, className, }: RecoverAccountFormProps): react_jsx_runtime.JSX.Element | null;
|
|
860
|
+
|
|
861
|
+
declare function ResetPasswordForm({ token, onSuccess, onError, className, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
862
|
+
|
|
709
863
|
declare function SignupForm({ onSuccess, onError, showUsernameField, showPhoneField, organizationName, acceptTermsRequired, onLoginClick, className, }: SignupFormProps): react_jsx_runtime.JSX.Element;
|
|
710
864
|
|
|
865
|
+
declare function TwoFactorForm({ onVerify, onError, autoSubmit, isLoading, className, }: TwoFactorFormProps): react_jsx_runtime.JSX.Element;
|
|
866
|
+
|
|
867
|
+
declare function OAuthButton({ provider, redirectUri, state, variant, size, className, }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
868
|
+
|
|
869
|
+
declare function DeviceList({ showTrustToggle, showRemoveAction, onDeviceTrusted, onDeviceUntrusted, onDeviceRemoved, renderDeviceIcon, className, }: DeviceListProps): react_jsx_runtime.JSX.Element;
|
|
870
|
+
|
|
871
|
+
declare function LoadingBoundary({ children, spinner, delay, className, }: LoadingBoundaryProps): react_jsx_runtime.JSX.Element | null;
|
|
872
|
+
|
|
873
|
+
declare function isEmail(value: string): boolean;
|
|
874
|
+
declare function maskEmail(email: string): string;
|
|
875
|
+
|
|
876
|
+
declare function LoginActivityFeed({ limit, showRiskBadge, showReportActions, filterByStatus, onSuspiciousReported, className, }: LoginActivityFeedProps): react_jsx_runtime.JSX.Element;
|
|
877
|
+
|
|
711
878
|
declare function OrganizationMenu({ showCreateNew, currentOrgId, onSwitch, onCreateNew, className, }: OrganizationMenuProps): react_jsx_runtime.JSX.Element;
|
|
712
879
|
|
|
713
880
|
declare function UserMenu({ showOrganization, menuItems, className }: UserMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
@@ -746,6 +913,32 @@ declare const otpVerifySchema$1: z.ZodObject<{
|
|
|
746
913
|
}>;
|
|
747
914
|
type OtpVerifyFormData$1 = z.infer<typeof otpVerifySchema$1>;
|
|
748
915
|
|
|
916
|
+
declare const emailOtpEmailSchema: z.ZodObject<{
|
|
917
|
+
email: z.ZodString;
|
|
918
|
+
}, "strip", z.ZodTypeAny, {
|
|
919
|
+
email: string;
|
|
920
|
+
}, {
|
|
921
|
+
email: string;
|
|
922
|
+
}>;
|
|
923
|
+
type EmailOtpEmailFormData = z.infer<typeof emailOtpEmailSchema>;
|
|
924
|
+
declare const emailOtpCodeSchema: z.ZodObject<{
|
|
925
|
+
code: z.ZodString;
|
|
926
|
+
}, "strip", z.ZodTypeAny, {
|
|
927
|
+
code: string;
|
|
928
|
+
}, {
|
|
929
|
+
code: string;
|
|
930
|
+
}>;
|
|
931
|
+
type EmailOtpCodeFormData = z.infer<typeof emailOtpCodeSchema>;
|
|
932
|
+
|
|
933
|
+
declare const forgotPasswordSchema: z.ZodObject<{
|
|
934
|
+
email: z.ZodString;
|
|
935
|
+
}, "strip", z.ZodTypeAny, {
|
|
936
|
+
email: string;
|
|
937
|
+
}, {
|
|
938
|
+
email: string;
|
|
939
|
+
}>;
|
|
940
|
+
type ForgotPasswordFormData = z.infer<typeof forgotPasswordSchema>;
|
|
941
|
+
|
|
749
942
|
declare const magicLinkSchema: z.ZodObject<{
|
|
750
943
|
email: z.ZodString;
|
|
751
944
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -789,6 +982,67 @@ declare const phonePasswordSchema: z.ZodObject<{
|
|
|
789
982
|
}>;
|
|
790
983
|
type PhonePasswordFormData = z.infer<typeof phonePasswordSchema>;
|
|
791
984
|
|
|
985
|
+
declare const recoverEmailSchema: z.ZodObject<{
|
|
986
|
+
email: z.ZodString;
|
|
987
|
+
}, "strip", z.ZodTypeAny, {
|
|
988
|
+
email: string;
|
|
989
|
+
}, {
|
|
990
|
+
email: string;
|
|
991
|
+
}>;
|
|
992
|
+
type RecoverEmailFormData = z.infer<typeof recoverEmailSchema>;
|
|
993
|
+
declare const recoverCodeSchema: z.ZodObject<{
|
|
994
|
+
code: z.ZodString;
|
|
995
|
+
}, "strip", z.ZodTypeAny, {
|
|
996
|
+
code: string;
|
|
997
|
+
}, {
|
|
998
|
+
code: string;
|
|
999
|
+
}>;
|
|
1000
|
+
type RecoverCodeFormData = z.infer<typeof recoverCodeSchema>;
|
|
1001
|
+
declare const recoverNewPasswordSchema: z.ZodEffects<z.ZodObject<{
|
|
1002
|
+
newPassword: z.ZodString;
|
|
1003
|
+
confirmPassword: z.ZodString;
|
|
1004
|
+
}, "strip", z.ZodTypeAny, {
|
|
1005
|
+
newPassword: string;
|
|
1006
|
+
confirmPassword: string;
|
|
1007
|
+
}, {
|
|
1008
|
+
newPassword: string;
|
|
1009
|
+
confirmPassword: string;
|
|
1010
|
+
}>, {
|
|
1011
|
+
newPassword: string;
|
|
1012
|
+
confirmPassword: string;
|
|
1013
|
+
}, {
|
|
1014
|
+
newPassword: string;
|
|
1015
|
+
confirmPassword: string;
|
|
1016
|
+
}>;
|
|
1017
|
+
type RecoverNewPasswordFormData = z.infer<typeof recoverNewPasswordSchema>;
|
|
1018
|
+
declare const recoverPhoneSchema: z.ZodObject<{
|
|
1019
|
+
phoneNumber: z.ZodString;
|
|
1020
|
+
}, "strip", z.ZodTypeAny, {
|
|
1021
|
+
phoneNumber: string;
|
|
1022
|
+
}, {
|
|
1023
|
+
phoneNumber: string;
|
|
1024
|
+
}>;
|
|
1025
|
+
type RecoverPhoneFormData = z.infer<typeof recoverPhoneSchema>;
|
|
1026
|
+
type RecoveryMethod = "email_link" | "email_code" | "phone_otp";
|
|
1027
|
+
|
|
1028
|
+
declare const resetPasswordSchema: z.ZodEffects<z.ZodObject<{
|
|
1029
|
+
newPassword: z.ZodString;
|
|
1030
|
+
confirmPassword: z.ZodString;
|
|
1031
|
+
}, "strip", z.ZodTypeAny, {
|
|
1032
|
+
newPassword: string;
|
|
1033
|
+
confirmPassword: string;
|
|
1034
|
+
}, {
|
|
1035
|
+
newPassword: string;
|
|
1036
|
+
confirmPassword: string;
|
|
1037
|
+
}>, {
|
|
1038
|
+
newPassword: string;
|
|
1039
|
+
confirmPassword: string;
|
|
1040
|
+
}, {
|
|
1041
|
+
newPassword: string;
|
|
1042
|
+
confirmPassword: string;
|
|
1043
|
+
}>;
|
|
1044
|
+
type ResetPasswordFormData = z.infer<typeof resetPasswordSchema>;
|
|
1045
|
+
|
|
792
1046
|
declare const signupSchema: z.ZodObject<{
|
|
793
1047
|
email: z.ZodString;
|
|
794
1048
|
password: z.ZodString;
|
|
@@ -799,28 +1053,49 @@ declare const signupSchema: z.ZodObject<{
|
|
|
799
1053
|
acceptTerms: z.ZodBoolean;
|
|
800
1054
|
captchaToken: z.ZodOptional<z.ZodString>;
|
|
801
1055
|
}, "strip", z.ZodTypeAny, {
|
|
802
|
-
password: string;
|
|
803
|
-
name: string;
|
|
804
1056
|
email: string;
|
|
1057
|
+
name: string;
|
|
1058
|
+
password: string;
|
|
805
1059
|
acceptTerms: boolean;
|
|
1060
|
+
username?: string | undefined;
|
|
806
1061
|
captchaToken?: string | undefined;
|
|
807
1062
|
phoneNumber?: string | undefined;
|
|
808
|
-
username?: string | undefined;
|
|
809
1063
|
organizationName?: string | undefined;
|
|
810
1064
|
}, {
|
|
811
|
-
password: string;
|
|
812
|
-
name: string;
|
|
813
1065
|
email: string;
|
|
1066
|
+
name: string;
|
|
1067
|
+
password: string;
|
|
814
1068
|
acceptTerms: boolean;
|
|
1069
|
+
username?: string | undefined;
|
|
815
1070
|
captchaToken?: string | undefined;
|
|
816
1071
|
phoneNumber?: string | undefined;
|
|
817
|
-
username?: string | undefined;
|
|
818
1072
|
organizationName?: string | undefined;
|
|
819
1073
|
}>;
|
|
820
1074
|
type SignupFormData = z.infer<typeof signupSchema>;
|
|
821
1075
|
|
|
1076
|
+
declare const totpSchema: z.ZodObject<{
|
|
1077
|
+
code: z.ZodString;
|
|
1078
|
+
}, "strip", z.ZodTypeAny, {
|
|
1079
|
+
code: string;
|
|
1080
|
+
}, {
|
|
1081
|
+
code: string;
|
|
1082
|
+
}>;
|
|
1083
|
+
type TotpFormData = z.infer<typeof totpSchema>;
|
|
1084
|
+
declare const backupCodeSchema: z.ZodObject<{
|
|
1085
|
+
backupCode: z.ZodString;
|
|
1086
|
+
}, "strip", z.ZodTypeAny, {
|
|
1087
|
+
backupCode: string;
|
|
1088
|
+
}, {
|
|
1089
|
+
backupCode: string;
|
|
1090
|
+
}>;
|
|
1091
|
+
type BackupCodeFormData = z.infer<typeof backupCodeSchema>;
|
|
1092
|
+
|
|
822
1093
|
declare function getInitials(name: string): string;
|
|
823
1094
|
|
|
1095
|
+
type RiskLevel = "low" | "medium" | "high";
|
|
1096
|
+
declare function getRiskLevel(score: number): RiskLevel;
|
|
1097
|
+
declare const RISK_COLORS: Record<RiskLevel, string>;
|
|
1098
|
+
|
|
824
1099
|
/**
|
|
825
1100
|
* Safely converts an unknown caught value to AuthError.
|
|
826
1101
|
* If the value is already an AuthError, returns it directly.
|
|
@@ -828,8 +1103,4 @@ declare function getInitials(name: string): string;
|
|
|
828
1103
|
*/
|
|
829
1104
|
declare function toAuthError(error: unknown): AuthError;
|
|
830
1105
|
|
|
831
|
-
type RiskLevel
|
|
832
|
-
declare function getRiskLevel(score: number): RiskLevel;
|
|
833
|
-
declare const RISK_COLORS: Record<RiskLevel, string>;
|
|
834
|
-
|
|
835
|
-
export { AUTH_ERROR_CODES, AccountSwitcher, type AccountSwitcherProps, AuthContext, type AuthContextValue, type AuthLocalization, AuthProvider, type AuthProviderProps, type CredentialLoginFormData, DeviceList, type DeviceListProps, LoadingBoundary, type LoadingBoundaryProps, LocalizationContext, type LocalizationContextValue, LoginActivityFeed, type LoginActivityFeedProps, LoginForm, type LoginFormProps, MagicLinkForm, type MagicLinkFormData, type MagicLinkFormProps, OAuthButton, type OAuthButtonProps, OrganizationMenu, type OrganizationMenuProps, type OtpVerifyFormData$1 as OtpVerifyFormData, PhoneLoginForm, type PhoneLoginFormData, type PhoneLoginFormProps, type PhoneNumberFormData, type OtpVerifyFormData as PhoneOtpVerifyFormData, type PhonePasswordFormData, RISK_COLORS, type RiskLevel, SessionGuard, type SessionGuardProps, SignupForm, type SignupFormData, type SignupFormProps, UserMenu, type UserMenuProps, authLocalization, credentialLoginSchema, getInitials, getLocalizedError, getRiskLevel, magicLinkSchema, otpVerifySchema$1 as otpVerifySchema, phoneLoginSchema, phoneNumberSchema, otpVerifySchema as phoneOtpVerifySchema, phonePasswordSchema, signupSchema, toAuthError, useApiKeys, useAuth, useAuthContext, useAuthLocalization, useDevices, useLoginActivity, useOrganizations, usePhone, useSession, useSessions, useUser };
|
|
1106
|
+
export { AUTH_ERROR_CODES, AccountSwitcher, type AccountSwitcherProps, AuthContext, type AuthContextValue, type AuthLocalization, AuthProvider, type AuthProviderProps, AuthView, type AuthViewPath, type AuthViewProps, type BackupCodeFormData, type CredentialLoginFormData, DeviceList, type DeviceListProps, EmailOTPForm, type EmailOTPFormProps, type EmailOtpCodeFormData, type EmailOtpEmailFormData, EmailVerificationForm, type EmailVerificationFormProps, ForgotPasswordForm, type ForgotPasswordFormData, type ForgotPasswordFormProps, LoadingBoundary, type LoadingBoundaryProps, LocalizationContext, type LocalizationContextValue, LoginActivityFeed, type LoginActivityFeedProps, LoginForm, type LoginFormProps, MagicLinkForm, type MagicLinkFormData, type MagicLinkFormProps, OAuthButton, type OAuthButtonProps, OrganizationMenu, type OrganizationMenuProps, type OtpVerifyFormData$1 as OtpVerifyFormData, PhoneLoginForm, type PhoneLoginFormData, type PhoneLoginFormProps, type PhoneNumberFormData, type OtpVerifyFormData as PhoneOtpVerifyFormData, type PhonePasswordFormData, RISK_COLORS, RecoverAccountForm, type RecoverAccountFormProps, type RecoverCodeFormData, type RecoverEmailFormData, type RecoverNewPasswordFormData, type RecoverPhoneFormData, type RecoveryMethod, ResetPasswordForm, type ResetPasswordFormData, type ResetPasswordFormProps, type RiskLevel, SessionGuard, type SessionGuardProps, SignupForm, type SignupFormData, type SignupFormProps, type TotpFormData, TwoFactorForm, type TwoFactorFormProps, UserMenu, type UserMenuProps, authLocalization, authViewPaths, backupCodeSchema, credentialLoginSchema, emailOtpCodeSchema, emailOtpEmailSchema, forgotPasswordSchema, getInitials, getLocalizedError, getRiskLevel, isEmail, magicLinkSchema, maskEmail, otpVerifySchema$1 as otpVerifySchema, phoneLoginSchema, phoneNumberSchema, otpVerifySchema as phoneOtpVerifySchema, phonePasswordSchema, recoverCodeSchema, recoverEmailSchema, recoverNewPasswordSchema, recoverPhoneSchema, resetPasswordSchema, signupSchema, toAuthError, totpSchema, useApiKeys, useAuth, useAuthContext, useAuthLocalization, useDevices, useLoginActivity, useOrganizations, usePhone, useSession, useSessions, useUser };
|