import { applyDecorators, UseGuards } from '@nestjs/common';
import { Throttle, ThrottlerGuard } from '@nestjs/throttler';

/**
 * Decorator to apply stricter rate limiting to authentication endpoints.
 * Uses the 'auth' throttler configuration: 5 requests per 60 seconds
 * 
 * Usage:
 * @AuthThrottle()
 * @Post('login')
 * login(@Body() dto: LoginDto) { ... }
 */
export const AuthThrottle = () => applyDecorators(Throttle({ auth: {} }), UseGuards(ThrottlerGuard));
