@dloizides/auth-web 1.21.0 → 1.22.1
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/CHANGELOG.md +635 -626
- package/dist/index.d.mts +131 -1
- package/dist/index.d.ts +131 -1
- package/dist/index.js +419 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +407 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -606,6 +606,32 @@ interface RegisterFormLabels {
|
|
|
606
606
|
}
|
|
607
607
|
declare const DEFAULT_REGISTER_LABELS: RegisterFormLabels;
|
|
608
608
|
|
|
609
|
+
/** Strings rendered by `<VerifyEmailScreen>`. */
|
|
610
|
+
interface VerifyEmailLabels {
|
|
611
|
+
loadingTitle: string;
|
|
612
|
+
loadingHint: string;
|
|
613
|
+
successTitle: string;
|
|
614
|
+
successBody: string;
|
|
615
|
+
successContinue: string;
|
|
616
|
+
successContinueHint: string;
|
|
617
|
+
errorTitle: string;
|
|
618
|
+
errorInvalid: string;
|
|
619
|
+
errorExpired: string;
|
|
620
|
+
errorUsed: string;
|
|
621
|
+
errorGeneric: string;
|
|
622
|
+
missingToken: string;
|
|
623
|
+
resendCta: string;
|
|
624
|
+
resendCtaHint: string;
|
|
625
|
+
resendEmailLabel: string;
|
|
626
|
+
resendEmailHint: string;
|
|
627
|
+
resendEmailPlaceholder: string;
|
|
628
|
+
resendMissingEmail: string;
|
|
629
|
+
resendSubmit: string;
|
|
630
|
+
resendSubmitHint: string;
|
|
631
|
+
resendConfirmation: string;
|
|
632
|
+
}
|
|
633
|
+
declare const DEFAULT_VERIFY_EMAIL_LABELS: VerifyEmailLabels;
|
|
634
|
+
|
|
609
635
|
/**
|
|
610
636
|
* Who asked for a prefill — the difference between "the user requested this" and
|
|
611
637
|
* "the app offered it".
|
|
@@ -1866,6 +1892,16 @@ declare const AuthTestIds: {
|
|
|
1866
1892
|
readonly demoCredentialsPassword: "auth-demo-credentials-password";
|
|
1867
1893
|
readonly demoCredentialsUseButton: "auth-demo-credentials-use";
|
|
1868
1894
|
readonly demoCredentialsToggle: "auth-demo-credentials-toggle";
|
|
1895
|
+
readonly verifyEmailScreen: "auth-verify-email";
|
|
1896
|
+
readonly verifyEmailLoading: "auth-verify-email-loading";
|
|
1897
|
+
readonly verifyEmailSuccess: "auth-verify-email-success";
|
|
1898
|
+
readonly verifyEmailContinue: "auth-verify-email-continue";
|
|
1899
|
+
readonly verifyEmailError: "auth-verify-email-error";
|
|
1900
|
+
readonly verifyEmailResendCta: "auth-verify-email-resend-cta";
|
|
1901
|
+
readonly verifyEmailResendForm: "auth-verify-email-resend-form";
|
|
1902
|
+
readonly verifyEmailResendEmail: "auth-verify-email-resend-email";
|
|
1903
|
+
readonly verifyEmailResendSubmit: "auth-verify-email-resend-submit";
|
|
1904
|
+
readonly verifyEmailResendConfirmation: "auth-verify-email-resend-confirmation";
|
|
1869
1905
|
};
|
|
1870
1906
|
/** Apply an optional prefix to a base test ID. */
|
|
1871
1907
|
declare function withTestIdPrefix(baseId: string, prefix?: string): string;
|
|
@@ -2876,4 +2912,98 @@ interface UseChangePasswordResult {
|
|
|
2876
2912
|
}
|
|
2877
2913
|
declare function useChangePassword({ client, onChanged, }: UseChangePasswordArgs): UseChangePasswordResult;
|
|
2878
2914
|
|
|
2879
|
-
|
|
2915
|
+
/** Why an email verification failed; the app maps each member to its own localised copy. */
|
|
2916
|
+
declare const enum VerifyEmailErrorCode {
|
|
2917
|
+
TokenInvalid = "TOKEN_INVALID",
|
|
2918
|
+
TokenExpired = "TOKEN_EXPIRED",
|
|
2919
|
+
TokenUsed = "TOKEN_USED",
|
|
2920
|
+
KeycloakUpdateFailed = "KEYCLOAK_UPDATE_FAILED",
|
|
2921
|
+
MissingToken = "MISSING_TOKEN",
|
|
2922
|
+
Generic = "GENERIC"
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
type VerifyEmailResult = {
|
|
2926
|
+
success: true;
|
|
2927
|
+
} | {
|
|
2928
|
+
success: false;
|
|
2929
|
+
errorCode: VerifyEmailErrorCode;
|
|
2930
|
+
};
|
|
2931
|
+
/** The capability the verify-email screen needs; never rejects for an expected outcome. */
|
|
2932
|
+
interface VerifyEmailCapableClient {
|
|
2933
|
+
verifyEmail(token: string): Promise<VerifyEmailResult>;
|
|
2934
|
+
resendVerification(email: string, verifyUrlTemplate?: string): Promise<boolean>;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
interface VerifyEmailScreenProps {
|
|
2938
|
+
client: VerifyEmailCapableClient;
|
|
2939
|
+
token: string;
|
|
2940
|
+
onContinue: () => void;
|
|
2941
|
+
theme?: AuthTheme;
|
|
2942
|
+
labels?: Partial<VerifyEmailLabels>;
|
|
2943
|
+
verifyUrlTemplate?: string;
|
|
2944
|
+
onVerified?: () => void;
|
|
2945
|
+
onFailed?: (errorCode: VerifyEmailErrorCode) => void;
|
|
2946
|
+
testIdPrefix?: string;
|
|
2947
|
+
}
|
|
2948
|
+
/** Verifies the emailed token on mount, then offers Continue or a resend-link form. */
|
|
2949
|
+
declare function VerifyEmailScreen({ client, token, onContinue, theme: themeProp, labels: labelsProp, verifyUrlTemplate, onVerified, onFailed, testIdPrefix, }: Readonly<VerifyEmailScreenProps>): ReactElement;
|
|
2950
|
+
|
|
2951
|
+
/** The three states the verify-email screen moves through. */
|
|
2952
|
+
declare const enum VerifyEmailPhase {
|
|
2953
|
+
Loading = "loading",
|
|
2954
|
+
Success = "success",
|
|
2955
|
+
Failure = "failure"
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
interface UseVerifyEmailArgs {
|
|
2959
|
+
client: VerifyEmailCapableClient;
|
|
2960
|
+
token: string;
|
|
2961
|
+
onVerified?: () => void;
|
|
2962
|
+
onFailed?: (errorCode: VerifyEmailErrorCode) => void;
|
|
2963
|
+
}
|
|
2964
|
+
interface UseVerifyEmailResult {
|
|
2965
|
+
phase: VerifyEmailPhase;
|
|
2966
|
+
errorCode: VerifyEmailErrorCode;
|
|
2967
|
+
}
|
|
2968
|
+
/** Posts the token once per value and reports loading, success or the failure code. */
|
|
2969
|
+
declare function useVerifyEmail({ client, token, onVerified, onFailed }: UseVerifyEmailArgs): UseVerifyEmailResult;
|
|
2970
|
+
|
|
2971
|
+
interface UseResendVerificationArgs {
|
|
2972
|
+
client: VerifyEmailCapableClient;
|
|
2973
|
+
verifyUrlTemplate?: string;
|
|
2974
|
+
}
|
|
2975
|
+
interface UseResendVerificationResult {
|
|
2976
|
+
email: string;
|
|
2977
|
+
setEmail: (value: string) => void;
|
|
2978
|
+
missingEmail: boolean;
|
|
2979
|
+
submitting: boolean;
|
|
2980
|
+
confirmed: boolean;
|
|
2981
|
+
submit: () => Promise<void>;
|
|
2982
|
+
}
|
|
2983
|
+
/** Resend-link form state; confirms whatever the BFF answers, so no address is ever revealed. */
|
|
2984
|
+
declare function useResendVerification({ client, verifyUrlTemplate }: UseResendVerificationArgs): UseResendVerificationResult;
|
|
2985
|
+
|
|
2986
|
+
interface CreateBffVerifyEmailClientOptions {
|
|
2987
|
+
baseUrl?: string;
|
|
2988
|
+
http?: HttpClient;
|
|
2989
|
+
}
|
|
2990
|
+
declare const VERIFY_EMAIL_ENDPOINT = "/bff/verify-email";
|
|
2991
|
+
declare const RESEND_VERIFICATION_ENDPOINT = "/bff/resend-verification";
|
|
2992
|
+
/** Same-origin BFF client for `POST /bff/verify-email` and `POST /bff/resend-verification`. */
|
|
2993
|
+
declare function createBffVerifyEmailClient(options?: CreateBffVerifyEmailClientOptions): VerifyEmailCapableClient;
|
|
2994
|
+
|
|
2995
|
+
declare const VERIFY_TOKEN_PLACEHOLDER = "{token}";
|
|
2996
|
+
interface BuildVerifyUrlTemplateOptions {
|
|
2997
|
+
origin?: string;
|
|
2998
|
+
fallbackOrigin?: string;
|
|
2999
|
+
path?: string;
|
|
3000
|
+
}
|
|
3001
|
+
/** Absolute verify-link template, e.g. `https://host/verify-email?token={token}`. */
|
|
3002
|
+
declare function buildVerifyUrlTemplate(options?: BuildVerifyUrlTemplateOptions): string;
|
|
3003
|
+
/** The token from a router query param that may arrive as a string, an array or nothing. */
|
|
3004
|
+
declare function readVerifyToken(raw: string | readonly string[] | undefined): string;
|
|
3005
|
+
|
|
3006
|
+
/** The failure body copy for a verification error code. */
|
|
3007
|
+
declare function verifyEmailErrorText(code: VerifyEmailErrorCode, labels: VerifyEmailLabels): string;
|
|
3008
|
+
|
|
3009
|
+
export { type AccountSettingsChangePasswordConfig, type AccountSettingsDevicePinConfig, type AccountSettingsLabels, type AccountSettingsPasskeysConfig, type AccountSettingsPreferredMethodConfig, AccountSettingsScreen, type AccountSettingsScreenProps, AuthScreen, type AuthScreenProps, AuthTestIds, type AuthTheme, type AuthThemeColors, AuthThemeProvider, type AuthThemeProviderProps, type AuthThemeRadii, type AuthThemeSpacing, type AuthThemeTypography, BffAuthStatus, type BffDeviceState, type BffLoginConfig, type BffLogoutClient, type BuildVerifyUrlTemplateOptions, CHANGE_PASSWORD_ENDPOINT, type ChangePasswordCapableClient, ChangePasswordCard, type ChangePasswordCardProps, ChangePasswordErrorKey, type ChangePasswordRequest, type ChangePasswordResult, type CreateBffAuthClientOptions, type CreateBffChangePasswordClientOptions, type CreateBffVerifyEmailClientOptions, DEFAULT_ACCOUNT_SETTINGS_LABELS, DEFAULT_AUTH_CARD_MAX_WIDTH, DEFAULT_DEMO_CREDENTIALS_HINT_LABELS, DEFAULT_DEVICE_PIN_ENROLL_LABELS, DEFAULT_DEVICE_PIN_SETTINGS_LABELS, DEFAULT_DEVICE_PIN_UNLOCK_LABELS, DEFAULT_FORGOT_PASSWORD_FIELDS_LABELS, DEFAULT_FORGOT_PASSWORD_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_OTP_LABELS, DEFAULT_PASSKEY_LOGIN_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_PIN_LABELS, DEFAULT_PREFERRED_METHOD_HINT_LABELS, DEFAULT_PREFERRED_METHOD_SETTINGS_LABELS, DEFAULT_REGISTER_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEFAULT_VERIFY_EMAIL_LABELS, DEVICE_PIN_ALLOWED_DIGITS, DEVICE_PIN_DEFAULT_DIGITS, DemoCredentialsHint, type DemoCredentialsHintLabels, type DemoCredentialsHintProps, DemoCredentialsHintVariant, type DemoCredentialsHintWiring, type DemoCredentialsLoginFormProps, type DevicePinCapableClient, type DevicePinDisableCapableClient, type DevicePinEnrollCapableClient, DevicePinEnrollErrorKey, DevicePinEnrollForm, type DevicePinEnrollFormProps, type DevicePinEnrollLabels, type DevicePinEnrollResult, DevicePinErrorKey, DevicePinInput, type DevicePinInputProps, DevicePinLengthPicker, type DevicePinLengthPickerProps, DevicePinOffer, type DevicePinOfferProps, DevicePinSettingsCard, type DevicePinSettingsCardProps, type DevicePinSettingsLabels, type DevicePinUnlockCapableClient, type DevicePinUnlockLabels, type DevicePinUnlockResult, DevicePinUnlockScreen, type DevicePinUnlockScreenProps, type DevicePinUnlockedUser, ForgotPasswordFields, type ForgotPasswordFieldsLabels, type ForgotPasswordFieldsProps, ForgotPasswordForm, type ForgotPasswordFormLabels, type ForgotPasswordFormProps, type LoginConfigCapableClient, LoginForm, type LoginFormLabels, type LoginFormProps, OtpForm, type OtpFormLabels, type OtpFormProps, OtpLoginStep, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasskeyCeremonyMode, PasskeyCeremonyStatus, type PasskeyErrorCode, PasskeyLoginButton, type PasskeyLoginButtonProps, type PasskeyLoginLabels, PasskeySettingsCard, type PasskeySettingsCardProps, type PasskeySettingsLabels, PasswordPolicyError, type PerformBffLogoutOptions, PinForm, type PinFormLabels, type PinFormProps, type PreferencesClientOptions, type PreferredMethodClient, PreferredMethodHint, type PreferredMethodHintLabels, type PreferredMethodHintProps, PreferredMethodSettingsCard, type PreferredMethodSettingsCardProps, type PreferredMethodSettingsLabels, PrefillIntent, RESEND_VERIFICATION_ENDPOINT, RegisterErrorCode, type RegisterField, type RegisterFieldLabels, RegisterForm, type RegisterFormLabels, type RegisterFormProps, type RegisterFormValues, type RegisterInputField, type RegisterPasswordPolicy, type RegisterSubmitOutcome, type RegisterSubmitValues, RegisterTestIds, ResetPasswordError, ResetPasswordForm, type ResetPasswordFormLabels, type ResetPasswordFormProps, type RoleRoute, type RoleRouteTable, type SplitName, type UseBffAuthOptions, type UseBffAuthResult, type UseBffForgotPasswordOptions, type UseBffLoginConfigResult, type UseBffResetPasswordOptions, type UseChangePasswordArgs, type UseChangePasswordResult, type UseDemoCredentialsOptions, type UseDemoCredentialsResult, type UseDevicePinDisableArgs, type UseDevicePinDisableResult, type UseDevicePinEnrollArgs, type UseDevicePinEnrollResult, type UseDevicePinUnlockArgs, type UseDevicePinUnlockResult, type UseForgotPasswordSubmitArgs, type UseForgotPasswordSubmitResult, type UseOtpLoginOptions, type UseOtpLoginResult, type UsePasskeyCeremonyOptions, type UsePasskeyCeremonyResult, type UsePinLoginOptions, type UsePinLoginResult, type UsePreferredMethodSettingArgs, type UsePreferredMethodSettingResult, type UseRegisterFormArgs, type UseRegisterFormResult, type UseResendVerificationArgs, type UseResendVerificationResult, type UseResetPasswordFormArgs, type UseResetPasswordFormResult, type UseVerifyEmailArgs, type UseVerifyEmailResult, VERIFY_EMAIL_ENDPOINT, VERIFY_TOKEN_PLACEHOLDER, type VerifyEmailCapableClient, VerifyEmailErrorCode, type VerifyEmailLabels, VerifyEmailPhase, type VerifyEmailResult, VerifyEmailScreen, type VerifyEmailScreenProps, buildVerifyUrlTemplate, cachePreferredMethod, clearCachedPreferredMethod, collectUserRoles, createBffAuthClient, createBffChangePasswordClient, createBffVerifyEmailClient, createPreferencesClient, defaultAuthTheme, deriveUsernameFromEmail, isAllowedPinDigits, isPasswordValid, isRegisterPasswordStrong, isValidForgotPasswordEmail, performBffLogout, readCachedPreferredMethod, readPasskeyError, readPasskeyRegistered, readVerifyToken, resolveAccessibleRoutes, resolveAccountList, resolveDemoAccounts, resolveDemoCredentials, resolvePostLoginRoute, splitFullName, startPasskeyLogin, startPasskeyRegistration, syncPreferredMethodFromServer, useAuthTheme, useBffAuth, useBffForgotPassword, useBffLoginConfig, useBffResetPassword, useChangePassword, useDemoCredentials, useDevicePinDisable, useDevicePinEnroll, useDevicePinUnlock, useForgotPasswordSubmit, useOtpLogin, usePasskeyCeremony, usePinLogin, usePreferredMethodSetting, useRegisterForm, useResendVerification, useResetPasswordForm, useVerifyEmail, validatePasswordPolicy, verifyEmailErrorText, withTestIdPrefix };
|
package/dist/index.d.ts
CHANGED
|
@@ -606,6 +606,32 @@ interface RegisterFormLabels {
|
|
|
606
606
|
}
|
|
607
607
|
declare const DEFAULT_REGISTER_LABELS: RegisterFormLabels;
|
|
608
608
|
|
|
609
|
+
/** Strings rendered by `<VerifyEmailScreen>`. */
|
|
610
|
+
interface VerifyEmailLabels {
|
|
611
|
+
loadingTitle: string;
|
|
612
|
+
loadingHint: string;
|
|
613
|
+
successTitle: string;
|
|
614
|
+
successBody: string;
|
|
615
|
+
successContinue: string;
|
|
616
|
+
successContinueHint: string;
|
|
617
|
+
errorTitle: string;
|
|
618
|
+
errorInvalid: string;
|
|
619
|
+
errorExpired: string;
|
|
620
|
+
errorUsed: string;
|
|
621
|
+
errorGeneric: string;
|
|
622
|
+
missingToken: string;
|
|
623
|
+
resendCta: string;
|
|
624
|
+
resendCtaHint: string;
|
|
625
|
+
resendEmailLabel: string;
|
|
626
|
+
resendEmailHint: string;
|
|
627
|
+
resendEmailPlaceholder: string;
|
|
628
|
+
resendMissingEmail: string;
|
|
629
|
+
resendSubmit: string;
|
|
630
|
+
resendSubmitHint: string;
|
|
631
|
+
resendConfirmation: string;
|
|
632
|
+
}
|
|
633
|
+
declare const DEFAULT_VERIFY_EMAIL_LABELS: VerifyEmailLabels;
|
|
634
|
+
|
|
609
635
|
/**
|
|
610
636
|
* Who asked for a prefill — the difference between "the user requested this" and
|
|
611
637
|
* "the app offered it".
|
|
@@ -1866,6 +1892,16 @@ declare const AuthTestIds: {
|
|
|
1866
1892
|
readonly demoCredentialsPassword: "auth-demo-credentials-password";
|
|
1867
1893
|
readonly demoCredentialsUseButton: "auth-demo-credentials-use";
|
|
1868
1894
|
readonly demoCredentialsToggle: "auth-demo-credentials-toggle";
|
|
1895
|
+
readonly verifyEmailScreen: "auth-verify-email";
|
|
1896
|
+
readonly verifyEmailLoading: "auth-verify-email-loading";
|
|
1897
|
+
readonly verifyEmailSuccess: "auth-verify-email-success";
|
|
1898
|
+
readonly verifyEmailContinue: "auth-verify-email-continue";
|
|
1899
|
+
readonly verifyEmailError: "auth-verify-email-error";
|
|
1900
|
+
readonly verifyEmailResendCta: "auth-verify-email-resend-cta";
|
|
1901
|
+
readonly verifyEmailResendForm: "auth-verify-email-resend-form";
|
|
1902
|
+
readonly verifyEmailResendEmail: "auth-verify-email-resend-email";
|
|
1903
|
+
readonly verifyEmailResendSubmit: "auth-verify-email-resend-submit";
|
|
1904
|
+
readonly verifyEmailResendConfirmation: "auth-verify-email-resend-confirmation";
|
|
1869
1905
|
};
|
|
1870
1906
|
/** Apply an optional prefix to a base test ID. */
|
|
1871
1907
|
declare function withTestIdPrefix(baseId: string, prefix?: string): string;
|
|
@@ -2876,4 +2912,98 @@ interface UseChangePasswordResult {
|
|
|
2876
2912
|
}
|
|
2877
2913
|
declare function useChangePassword({ client, onChanged, }: UseChangePasswordArgs): UseChangePasswordResult;
|
|
2878
2914
|
|
|
2879
|
-
|
|
2915
|
+
/** Why an email verification failed; the app maps each member to its own localised copy. */
|
|
2916
|
+
declare const enum VerifyEmailErrorCode {
|
|
2917
|
+
TokenInvalid = "TOKEN_INVALID",
|
|
2918
|
+
TokenExpired = "TOKEN_EXPIRED",
|
|
2919
|
+
TokenUsed = "TOKEN_USED",
|
|
2920
|
+
KeycloakUpdateFailed = "KEYCLOAK_UPDATE_FAILED",
|
|
2921
|
+
MissingToken = "MISSING_TOKEN",
|
|
2922
|
+
Generic = "GENERIC"
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
type VerifyEmailResult = {
|
|
2926
|
+
success: true;
|
|
2927
|
+
} | {
|
|
2928
|
+
success: false;
|
|
2929
|
+
errorCode: VerifyEmailErrorCode;
|
|
2930
|
+
};
|
|
2931
|
+
/** The capability the verify-email screen needs; never rejects for an expected outcome. */
|
|
2932
|
+
interface VerifyEmailCapableClient {
|
|
2933
|
+
verifyEmail(token: string): Promise<VerifyEmailResult>;
|
|
2934
|
+
resendVerification(email: string, verifyUrlTemplate?: string): Promise<boolean>;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
interface VerifyEmailScreenProps {
|
|
2938
|
+
client: VerifyEmailCapableClient;
|
|
2939
|
+
token: string;
|
|
2940
|
+
onContinue: () => void;
|
|
2941
|
+
theme?: AuthTheme;
|
|
2942
|
+
labels?: Partial<VerifyEmailLabels>;
|
|
2943
|
+
verifyUrlTemplate?: string;
|
|
2944
|
+
onVerified?: () => void;
|
|
2945
|
+
onFailed?: (errorCode: VerifyEmailErrorCode) => void;
|
|
2946
|
+
testIdPrefix?: string;
|
|
2947
|
+
}
|
|
2948
|
+
/** Verifies the emailed token on mount, then offers Continue or a resend-link form. */
|
|
2949
|
+
declare function VerifyEmailScreen({ client, token, onContinue, theme: themeProp, labels: labelsProp, verifyUrlTemplate, onVerified, onFailed, testIdPrefix, }: Readonly<VerifyEmailScreenProps>): ReactElement;
|
|
2950
|
+
|
|
2951
|
+
/** The three states the verify-email screen moves through. */
|
|
2952
|
+
declare const enum VerifyEmailPhase {
|
|
2953
|
+
Loading = "loading",
|
|
2954
|
+
Success = "success",
|
|
2955
|
+
Failure = "failure"
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
interface UseVerifyEmailArgs {
|
|
2959
|
+
client: VerifyEmailCapableClient;
|
|
2960
|
+
token: string;
|
|
2961
|
+
onVerified?: () => void;
|
|
2962
|
+
onFailed?: (errorCode: VerifyEmailErrorCode) => void;
|
|
2963
|
+
}
|
|
2964
|
+
interface UseVerifyEmailResult {
|
|
2965
|
+
phase: VerifyEmailPhase;
|
|
2966
|
+
errorCode: VerifyEmailErrorCode;
|
|
2967
|
+
}
|
|
2968
|
+
/** Posts the token once per value and reports loading, success or the failure code. */
|
|
2969
|
+
declare function useVerifyEmail({ client, token, onVerified, onFailed }: UseVerifyEmailArgs): UseVerifyEmailResult;
|
|
2970
|
+
|
|
2971
|
+
interface UseResendVerificationArgs {
|
|
2972
|
+
client: VerifyEmailCapableClient;
|
|
2973
|
+
verifyUrlTemplate?: string;
|
|
2974
|
+
}
|
|
2975
|
+
interface UseResendVerificationResult {
|
|
2976
|
+
email: string;
|
|
2977
|
+
setEmail: (value: string) => void;
|
|
2978
|
+
missingEmail: boolean;
|
|
2979
|
+
submitting: boolean;
|
|
2980
|
+
confirmed: boolean;
|
|
2981
|
+
submit: () => Promise<void>;
|
|
2982
|
+
}
|
|
2983
|
+
/** Resend-link form state; confirms whatever the BFF answers, so no address is ever revealed. */
|
|
2984
|
+
declare function useResendVerification({ client, verifyUrlTemplate }: UseResendVerificationArgs): UseResendVerificationResult;
|
|
2985
|
+
|
|
2986
|
+
interface CreateBffVerifyEmailClientOptions {
|
|
2987
|
+
baseUrl?: string;
|
|
2988
|
+
http?: HttpClient;
|
|
2989
|
+
}
|
|
2990
|
+
declare const VERIFY_EMAIL_ENDPOINT = "/bff/verify-email";
|
|
2991
|
+
declare const RESEND_VERIFICATION_ENDPOINT = "/bff/resend-verification";
|
|
2992
|
+
/** Same-origin BFF client for `POST /bff/verify-email` and `POST /bff/resend-verification`. */
|
|
2993
|
+
declare function createBffVerifyEmailClient(options?: CreateBffVerifyEmailClientOptions): VerifyEmailCapableClient;
|
|
2994
|
+
|
|
2995
|
+
declare const VERIFY_TOKEN_PLACEHOLDER = "{token}";
|
|
2996
|
+
interface BuildVerifyUrlTemplateOptions {
|
|
2997
|
+
origin?: string;
|
|
2998
|
+
fallbackOrigin?: string;
|
|
2999
|
+
path?: string;
|
|
3000
|
+
}
|
|
3001
|
+
/** Absolute verify-link template, e.g. `https://host/verify-email?token={token}`. */
|
|
3002
|
+
declare function buildVerifyUrlTemplate(options?: BuildVerifyUrlTemplateOptions): string;
|
|
3003
|
+
/** The token from a router query param that may arrive as a string, an array or nothing. */
|
|
3004
|
+
declare function readVerifyToken(raw: string | readonly string[] | undefined): string;
|
|
3005
|
+
|
|
3006
|
+
/** The failure body copy for a verification error code. */
|
|
3007
|
+
declare function verifyEmailErrorText(code: VerifyEmailErrorCode, labels: VerifyEmailLabels): string;
|
|
3008
|
+
|
|
3009
|
+
export { type AccountSettingsChangePasswordConfig, type AccountSettingsDevicePinConfig, type AccountSettingsLabels, type AccountSettingsPasskeysConfig, type AccountSettingsPreferredMethodConfig, AccountSettingsScreen, type AccountSettingsScreenProps, AuthScreen, type AuthScreenProps, AuthTestIds, type AuthTheme, type AuthThemeColors, AuthThemeProvider, type AuthThemeProviderProps, type AuthThemeRadii, type AuthThemeSpacing, type AuthThemeTypography, BffAuthStatus, type BffDeviceState, type BffLoginConfig, type BffLogoutClient, type BuildVerifyUrlTemplateOptions, CHANGE_PASSWORD_ENDPOINT, type ChangePasswordCapableClient, ChangePasswordCard, type ChangePasswordCardProps, ChangePasswordErrorKey, type ChangePasswordRequest, type ChangePasswordResult, type CreateBffAuthClientOptions, type CreateBffChangePasswordClientOptions, type CreateBffVerifyEmailClientOptions, DEFAULT_ACCOUNT_SETTINGS_LABELS, DEFAULT_AUTH_CARD_MAX_WIDTH, DEFAULT_DEMO_CREDENTIALS_HINT_LABELS, DEFAULT_DEVICE_PIN_ENROLL_LABELS, DEFAULT_DEVICE_PIN_SETTINGS_LABELS, DEFAULT_DEVICE_PIN_UNLOCK_LABELS, DEFAULT_FORGOT_PASSWORD_FIELDS_LABELS, DEFAULT_FORGOT_PASSWORD_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_OTP_LABELS, DEFAULT_PASSKEY_LOGIN_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_PIN_LABELS, DEFAULT_PREFERRED_METHOD_HINT_LABELS, DEFAULT_PREFERRED_METHOD_SETTINGS_LABELS, DEFAULT_REGISTER_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEFAULT_VERIFY_EMAIL_LABELS, DEVICE_PIN_ALLOWED_DIGITS, DEVICE_PIN_DEFAULT_DIGITS, DemoCredentialsHint, type DemoCredentialsHintLabels, type DemoCredentialsHintProps, DemoCredentialsHintVariant, type DemoCredentialsHintWiring, type DemoCredentialsLoginFormProps, type DevicePinCapableClient, type DevicePinDisableCapableClient, type DevicePinEnrollCapableClient, DevicePinEnrollErrorKey, DevicePinEnrollForm, type DevicePinEnrollFormProps, type DevicePinEnrollLabels, type DevicePinEnrollResult, DevicePinErrorKey, DevicePinInput, type DevicePinInputProps, DevicePinLengthPicker, type DevicePinLengthPickerProps, DevicePinOffer, type DevicePinOfferProps, DevicePinSettingsCard, type DevicePinSettingsCardProps, type DevicePinSettingsLabels, type DevicePinUnlockCapableClient, type DevicePinUnlockLabels, type DevicePinUnlockResult, DevicePinUnlockScreen, type DevicePinUnlockScreenProps, type DevicePinUnlockedUser, ForgotPasswordFields, type ForgotPasswordFieldsLabels, type ForgotPasswordFieldsProps, ForgotPasswordForm, type ForgotPasswordFormLabels, type ForgotPasswordFormProps, type LoginConfigCapableClient, LoginForm, type LoginFormLabels, type LoginFormProps, OtpForm, type OtpFormLabels, type OtpFormProps, OtpLoginStep, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasskeyCeremonyMode, PasskeyCeremonyStatus, type PasskeyErrorCode, PasskeyLoginButton, type PasskeyLoginButtonProps, type PasskeyLoginLabels, PasskeySettingsCard, type PasskeySettingsCardProps, type PasskeySettingsLabels, PasswordPolicyError, type PerformBffLogoutOptions, PinForm, type PinFormLabels, type PinFormProps, type PreferencesClientOptions, type PreferredMethodClient, PreferredMethodHint, type PreferredMethodHintLabels, type PreferredMethodHintProps, PreferredMethodSettingsCard, type PreferredMethodSettingsCardProps, type PreferredMethodSettingsLabels, PrefillIntent, RESEND_VERIFICATION_ENDPOINT, RegisterErrorCode, type RegisterField, type RegisterFieldLabels, RegisterForm, type RegisterFormLabels, type RegisterFormProps, type RegisterFormValues, type RegisterInputField, type RegisterPasswordPolicy, type RegisterSubmitOutcome, type RegisterSubmitValues, RegisterTestIds, ResetPasswordError, ResetPasswordForm, type ResetPasswordFormLabels, type ResetPasswordFormProps, type RoleRoute, type RoleRouteTable, type SplitName, type UseBffAuthOptions, type UseBffAuthResult, type UseBffForgotPasswordOptions, type UseBffLoginConfigResult, type UseBffResetPasswordOptions, type UseChangePasswordArgs, type UseChangePasswordResult, type UseDemoCredentialsOptions, type UseDemoCredentialsResult, type UseDevicePinDisableArgs, type UseDevicePinDisableResult, type UseDevicePinEnrollArgs, type UseDevicePinEnrollResult, type UseDevicePinUnlockArgs, type UseDevicePinUnlockResult, type UseForgotPasswordSubmitArgs, type UseForgotPasswordSubmitResult, type UseOtpLoginOptions, type UseOtpLoginResult, type UsePasskeyCeremonyOptions, type UsePasskeyCeremonyResult, type UsePinLoginOptions, type UsePinLoginResult, type UsePreferredMethodSettingArgs, type UsePreferredMethodSettingResult, type UseRegisterFormArgs, type UseRegisterFormResult, type UseResendVerificationArgs, type UseResendVerificationResult, type UseResetPasswordFormArgs, type UseResetPasswordFormResult, type UseVerifyEmailArgs, type UseVerifyEmailResult, VERIFY_EMAIL_ENDPOINT, VERIFY_TOKEN_PLACEHOLDER, type VerifyEmailCapableClient, VerifyEmailErrorCode, type VerifyEmailLabels, VerifyEmailPhase, type VerifyEmailResult, VerifyEmailScreen, type VerifyEmailScreenProps, buildVerifyUrlTemplate, cachePreferredMethod, clearCachedPreferredMethod, collectUserRoles, createBffAuthClient, createBffChangePasswordClient, createBffVerifyEmailClient, createPreferencesClient, defaultAuthTheme, deriveUsernameFromEmail, isAllowedPinDigits, isPasswordValid, isRegisterPasswordStrong, isValidForgotPasswordEmail, performBffLogout, readCachedPreferredMethod, readPasskeyError, readPasskeyRegistered, readVerifyToken, resolveAccessibleRoutes, resolveAccountList, resolveDemoAccounts, resolveDemoCredentials, resolvePostLoginRoute, splitFullName, startPasskeyLogin, startPasskeyRegistration, syncPreferredMethodFromServer, useAuthTheme, useBffAuth, useBffForgotPassword, useBffLoginConfig, useBffResetPassword, useChangePassword, useDemoCredentials, useDevicePinDisable, useDevicePinEnroll, useDevicePinUnlock, useForgotPasswordSubmit, useOtpLogin, usePasskeyCeremony, usePinLogin, usePreferredMethodSetting, useRegisterForm, useResendVerification, useResetPasswordForm, useVerifyEmail, validatePasswordPolicy, verifyEmailErrorText, withTestIdPrefix };
|