/** * DTO for user login with security-focused validation * * Security: * - Identifier validated (email, username, or phone) * - Password length enforced * - Input sanitization applied * - DeviceId validated if provided */ export declare class LoginDTO { /** * Login identifier (email, username, or phone) * * Validation: * - At least 1 character * - Max 255 characters (prevents attacks) * * Sanitization: * - Trimmed * - Lowercased if it looks like email */ identifier: string; /** * User password * * Validation: * - At least 1 character (lenient for login) * - Max 128 characters (prevents DoS) * * Note: NOT trimmed (passwords can have spaces) */ password: string; /** * Optional device name for session identification * * Validation: * - Max 255 characters (matches DB constraint: varchar(255)) * * Sanitization: * - Trimmed */ deviceName?: string; /** * Optional device type * * Validation: * - Must be one of: mobile, desktop, tablet * - Max 50 characters (matches DB constraint: varchar(50)) * * Sanitization: * - Trimmed and lowercased */ deviceType?: 'mobile' | 'desktop' | 'tablet'; /** * Optional reCAPTCHA token * * Required when server has reCAPTCHA enabled and enforces validation * for the current token delivery mode (typically 'cookies' for web). * * Validation: * - Must be a string * - Token is single-use and expires after 2 minutes * - Token must be generated for correct action (e.g., 'login') * * Security: * - Token validation happens server-side only * - Invalid/expired tokens result in RECAPTCHA_VALIDATION_FAILED error * - Low scores (v3) result in RECAPTCHA_SCORE_TOO_LOW error * * @example Web app (v3 automatic) * ```typescript * // Angular: Token auto-generated by AuthService * await this.authService.login(email, password); * * // Vanilla JS: Generate token manually * const token = await grecaptcha.execute(siteKey, { action: 'login' }); * await client.login({ identifier, password, recaptchaToken: token }); * ``` * * @example Web app (v2 checkbox) * ```typescript * const token = grecaptcha.getResponse(widgetId); * await client.login({ identifier, password, recaptchaToken: token }); * ``` */ recaptchaToken?: string; } //# sourceMappingURL=login.dto.d.ts.map