import type { AcceptInvitationState } from './AcceptInvitationState/interfaces'; import type { AccountSettingsState } from './AccountSettingsState/interfaces'; import type { ActivateAccountState } from './ActivateAccountState/interfaces'; import type { ApprovalFlowState } from './ApprovalFlowState/interfaces'; import type { ApiTokensState } from './ApiTokensState/interfaces'; import type { CustomLoginState } from './CustomLoginState/interfaces'; import type { ForgotPasswordState } from './ForgotPasswordState/interfaces'; import type { GroupsState } from './GroupsState/interfaces'; import type { GroupsDialogsState } from './GroupsDialogsState/interfaces'; import type { ImpersonateState } from './ImpersonateState/interfaces'; import type { LoginState } from './LoginState/interfaces'; import type { MFAState } from './MfaState/interfaces'; import type { PasskeysState } from './PasskeysState/interfaces'; import type { IEnvironmentRoleAssignment, IUserProfile, RedirectOptions, SocialLoginProviders } from '@frontegg/rest-api'; import type { ProfileState } from './ProfileState/interfaces'; import type { ProvisioningState } from './ProvisioningState/interfaces'; import type { ResetPhoneNumberState } from './ResetPhoneNumberState/interfaces'; import type { RolesState } from './RolesState/interfaces'; import type { SessionsPolicyState } from './Security/SessionsPolicyState/interfaces'; import type { SecurityPolicyState } from './Security/SecurityPolicyState/interfaces'; import type { SecurityCenterState } from './Security/SecurityCenterState/interfaces'; import type { RestrictionsState } from './Security/RestrictionsState/interfaces'; import type { SessionsState } from './SessionsState/interfaces'; import type { SignUpState } from './SignUpState/interfaces'; import type { SmsState } from './SmsState/interfaces'; import type { SocialLoginState } from './SocialLoginState/interfaces'; import type { SSOState } from './SSOState/interfaces'; import type { StepUpState } from './StepUpState/interfaces'; import type { TeamState } from './TeamState/interfaces'; import type { TenantsState } from './TenantsState/interfaces'; import type { IAllAccountsDialogsState, IAllAccountsState } from './MSP/interfaces'; import { ApplicationsState } from './ApplicationsState/interfaces'; import { UnlockAccountState } from './UnlockAccountState/interfaces'; import { PasswordRotationState } from '../toolkit'; import { UsernamesState } from './UsernamesState/interfaces'; import { UserEmailPolicyState } from './UsersEmailsPolicyState/interfaces'; export declare enum REQUEST_NAME { LOAD_FEATURE_FLAGS = "LOAD_FEATURE_FLAGS,", LOAD_ADMIN_BOX_METADATA = "LOAD_ADMIN_BOX_METADATA,", LOAD_SSO_PUBLIC_CONFIGURATION = "LOAD_SSO_PUBLIC_CONFIGURATION,", LOAD_PUBLIC_AUTH_STRATEGIES_POLICY = "LOAD_PUBLIC_AUTH_STRATEGIES_POLICY,", LOAD_ALLOW_SIGNUPS = "LOAD_ALLOW_SIGNUPS,", LOAD_CUSTOM_LOGIN_ROUTES = "LOAD_CUSTOM_LOGIN_ROUTES", LOAD_PASSWORD_CONFIGURATION = "LOAD_PASSWORD_CONFIGURATION" } export interface SingleErrorByRequestDataPayload { requestName: REQUEST_NAME; traceId?: string; } export interface SingleErrorByRequestData { isError: boolean; traceId?: string; } export interface UserIPData { ip?: string; countryCode?: string | null; loading?: boolean; } export type ErrorByRequest = Partial>; export interface AuthState extends Routes, PluginOptions { onRedirectTo: (path: string, opts?: RedirectOptions) => void; error?: any; errorByRequest: ErrorByRequest; isAuthenticated: boolean; userIp?: string; userIpData?: UserIPData; isLoading: boolean; keepSessionAlive?: boolean; socialLoginOptions?: { promptConsent?: boolean; }; /** * Post-login "choose your organization" step. Set via `authOptions.tenantSelection`; read by the * afterAuthNavigation choose-tenant gate. Also gated by the `login-box-choose-tenant` feature flag. */ tenantSelection?: { enabled?: boolean; }; user?: User | null; isSSOAuth: boolean; ssoACS?: string; includeQueryParam?: boolean; hostedLoginBox?: boolean; disableSilentRefresh?: boolean; enforceRedirectToSameSite?: boolean; allowedRedirectOrigins?: string[]; acceptInvitationState: AcceptInvitationState; accountSettingsState: AccountSettingsState; activateAccountState: ActivateAccountState; unlockAccountState: UnlockAccountState; approvalFlowState: ApprovalFlowState; apiTokensState: ApiTokensState; customLoginState: CustomLoginState; forgotPasswordState: ForgotPasswordState; passwordRotationState: PasswordRotationState; groupsState: GroupsState; groupsDialogsState: GroupsDialogsState; impersonateState: ImpersonateState; loginState: LoginState; mfaState: MFAState; allAccountsState: IAllAccountsState; allAccountsDialogsState: IAllAccountsDialogsState; passkeysState: PasskeysState; profileState: ProfileState; provisioningState: ProvisioningState; resetPhoneNumberState: ResetPhoneNumberState; rolesState: RolesState; restrictionsState: RestrictionsState; securityCenterState: SecurityCenterState; securityPolicyState: SecurityPolicyState; sessionsPolicyState: SessionsPolicyState; sessionsState: SessionsState; signUpState: SignUpState; smsState: SmsState; socialLoginState: SocialLoginState; ssoState: SSOState; stepUpState: StepUpState; teamState: TeamState; tenantsState: TenantsState; applicationsState: ApplicationsState; usernamesState: UsernamesState; userEmailPolicyState: UserEmailPolicyState; } interface Actor { sub?: string; } export interface User extends IUserProfile { accessToken: string; refreshToken?: string; expiresIn: number; /** * @deprecated use exp instead */ expires: string; exp: number; sid?: string; act?: Actor; subAccountAccessAllowed?: boolean; amr?: string[]; acr?: string; auth_time?: number; resetToken?: string; passwordExpiresIn?: number; notificationPeriod?: number; resetPasswordToken?: string; userId?: string; } export interface Routes { routes: AuthPageRoutes; } interface PluginOptions { header?: any; loaderComponent?: any; } export type AuthPageRoutes = { /** * the page whither need to redirect in the case when a user is authenticated * @default: url before redirect to log in or '/' */ authenticatedUrl: string; /** * the page whither need to redirect in the case when a user is not authenticated */ loginUrl: string; /** * the page whether you need to redirect in the case when a customer asks to step up and the user doesn't step up already */ stepUpUrl: string; /** * navigating to this url, AuthProvider will log out and remove cookies */ logoutUrl: string; /** * the page whither need to redirect in the case when a user wants to activate their account */ activateUrl: string; /** * the page whither need to redirect in the case when a user wants to activate their account with code */ activateWithOTCUrl: string; /** * the page whither need to redirect in the case when a user wants to impersonate another user */ impersonationUrl: string; /** * the page whether you need to redirect in the case when a user wants to accept invite to tenant */ acceptInvitationUrl: string; /** * the page whether you need to redirect in the case when a user wants to accept invite to tenant with OTC */ acceptInvitationWithOTCUrl: string; /** * the page in the case a user forgot his account password */ forgetPasswordUrl: string; /** * the page in the case a user wants to reset their account phone number */ resetPhoneNumberUrl: string; /** * the page whither need to redirect in the case when a user redirected from reset password url */ resetPasswordUrl: string; /** * the url to reach the idp redirect after successful SAML response */ samlCallbackUrl?: string; /** * the url to reach the idp redirect after successful SAML response */ socialLoginCallbackUrl?: string; /** * sign up page */ signUpUrl: string; /** * oidc success redirect url */ oidcRedirectUrl?: string; /** * magic link redirect url */ magicLinkCallbackUrl?: string; /** * after sign-up success url, the order of urls read: * (accountSignUpSuccessUrl or userSignUpSuccessUrl) / signupSuccessUrl / authenticationUrl */ signUpSuccessUrl?: string; /** * after account sign-up success url, the order of urls read: * accountSignUpSuccessUrl / signupSuccessUrl / authenticationUrl */ accountSignUpSuccessUrl?: string; /** * after user (tenant) sign up success url, the order of urls read: userSignUpSuccessUrl / signupSuccessUrl / authenticationUrl */ userSignUpSuccessUrl?: string; /** * hosted login callback redirect url */ hostedLoginRedirectUrl?: string; /** * custom login url */ customLoginUrl?: string; /** * custom login Authenticated url */ customLoginAuthenticatedUrl?: string; /** * open app url used for redirecting to app after login */ openAppUrl?: string; /** * unlock account url */ unlockAccountUrl?: string; /** * submit approval flow decision url */ approvalFlowUrl?: string; /** * Multi-Factor authenticator for mobile * Private router used for direct access to the two-factor authenticator for mobile * @default: '/account/mfa-mobile-authenticator' */ mfaMobileAuthenticator?: string; }; export declare enum UserVerifiedOriginTypes { SOCIAL_LOGIN = "SOCIAL_LOGIN", PASSWORDLESS = "PASSWORDLESS", ACTIVATION_LINK = "ACTIVATION_LINK" } export declare enum AuthenticationTypes { SOCIAL_LOGIN = "SOCIAL_LOGIN", PASSWORD = "PASSWORD", PHONE_NUMBER = "PHONE_NUMBER", USERNAME = "USERNAME" } export declare enum AdminPortalPagesForEvents { profile = "profile", privacy = "privacy", personalApiTokens = "personalApiTokens", account = "account", users = "users", groups = "groups", security = "security", sso = "sso", audits = "audits", webhooks = "webhooks", apiTokens = "apiTokens", roles = "roles", subscriptions = "subscription", allAccounts = "allAccounts" } export declare const AdminPortalPages: Record; export interface CustomEventsOptions { userVerified?: (payload: IUserVerifiedPayload) => void; signUpComplete?: (payload: ISignUpCompletePayload) => void; inviteMemberClicked?: (payload: IInviteMemberClickedPayload) => void; inviteMemberSubmit?: (payload: IInviteMemberSubmitPayload) => void; inviteMembersSubmit?: (payload: IInviteMembersSubmitPayload) => void; adminBoxMenuClicked?: (payload: IAdminBoxMenuClicked) => void; } export interface IUserVerifiedPayload { email: string; origin: UserVerifiedOriginTypes; createdAt?: Date; tenantId?: string; id?: string; url?: URL; name?: string; } export interface IInviteMemberClickedPayload { email: string; } export interface IInviteMemberSubmitPayload { email: string; invitedUserFullName?: string; invitedUserEmail: string; invitedUserPhoneNumber?: string; invitedUserRoles?: string[]; invitedUserEnvironmentRoles?: IEnvironmentRoleAssignment[]; expirationInSeconds?: number; } export interface IInviteMembersSubmitPayload { email: string; invitedUserEmails: string[]; invitedUsersRoles?: string[]; invitedUsersEnvironmentRoles?: IEnvironmentRoleAssignment[]; expirationInSeconds?: number; } export interface ISignUpCompletePayload { name?: string; companyName?: string; phoneNumber?: string; email?: string; id?: string; createdAt?: Date; tenantId?: string; url?: URL; authenticationType: AuthenticationTypes; socialProvider?: SocialLoginProviders; } export interface IAdminBoxMenuClicked { email: string; tab: AdminPortalPagesForEvents; } export {};