react-cookie-auth
Version:
Authentication library with HTTP-only cookies and Page Visibility API for handling sleep/wake cycles
38 lines (37 loc) • 1.09 kB
TypeScript
import React from 'react';
import { UseLoginMutation } from '../state/authApi';
/**
* AuthModal configuration options
*/
export interface AuthModalConfig {
titleText?: string;
usernameLabel?: string;
usernamePlaceholder?: string;
passwordLabel?: string;
passwordPlaceholder?: string;
submitButtonText?: string;
loadingText?: string;
successMessage?: string;
modalSize?: 'small' | 'medium' | 'large' | 'xl' | '2xl' | '3xl' | 'full';
formClassName?: string;
inputClassName?: string;
buttonClassName?: string;
errorClassName?: string;
onLoginSuccess?: (username: string) => void;
showRememberMe?: boolean;
rememberMeLabel?: string;
}
/**
* Props for the AuthModal component
*/
export interface AuthModalProps {
isOpen: boolean;
onClose: () => void;
useLoginMutation: UseLoginMutation;
config?: AuthModalConfig;
}
/**
* Authentication modal component for login functionality
* Configurable via the config prop
*/
export declare const AuthModal: React.FC<AuthModalProps>;