Fix: Rate Limit y Variables para Testeos Locales
This commit is contained in:
@@ -34,8 +34,8 @@ public class AuthController : ControllerBase
|
|||||||
{
|
{
|
||||||
HttpOnly = true, // Seguridad: JS no puede leer esto
|
HttpOnly = true, // Seguridad: JS no puede leer esto
|
||||||
Expires = DateTime.UtcNow.AddMinutes(15),
|
Expires = DateTime.UtcNow.AddMinutes(15),
|
||||||
Secure = true, // Solo HTTPS (localhost con https cuenta)
|
Secure = false, // Solo HTTPS (Para tests locales 'Secure = false' temporalmente)
|
||||||
SameSite = SameSiteMode.Strict,
|
SameSite = SameSiteMode.Lax, // Protección CSRF (Strict para máxima seguridad, pero puede ser Lax si hay problemas con redirecciones y testeos locales)
|
||||||
IsEssential = true
|
IsEssential = true
|
||||||
};
|
};
|
||||||
Response.Cookies.Append(cookieName, token, cookieOptions);
|
Response.Cookies.Append(cookieName, token, cookieOptions);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { AdsV2Service } from '../services/ads.v2.service';
|
|||||||
import { AdminService } from '../services/admin.service';
|
import { AdminService } from '../services/admin.service';
|
||||||
import { ChatService, type ChatMessage } from '../services/chat.service';
|
import { ChatService, type ChatMessage } from '../services/chat.service';
|
||||||
import { getImageUrl, formatCurrency, parseUTCDate } from '../utils/app.utils';
|
import { getImageUrl, formatCurrency, parseUTCDate } from '../utils/app.utils';
|
||||||
import { AuthService } from '../services/auth.service';
|
|
||||||
import {
|
import {
|
||||||
VEHICLE_TYPES,
|
VEHICLE_TYPES,
|
||||||
AUTO_SEGMENTS,
|
AUTO_SEGMENTS,
|
||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
VEHICLE_CONDITIONS,
|
VEHICLE_CONDITIONS,
|
||||||
STEERING_TYPES
|
STEERING_TYPES
|
||||||
} from '../constants/vehicleOptions';
|
} from '../constants/vehicleOptions';
|
||||||
|
import { useAuth } from '../context/AuthContext';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
adSummary: any;
|
adSummary: any;
|
||||||
@@ -44,7 +45,8 @@ export default function ModerationModal({ adSummary, onClose, onApprove }: Props
|
|||||||
const [photosToDelete, setPhotosToDelete] = useState<number[]>([]);
|
const [photosToDelete, setPhotosToDelete] = useState<number[]>([]);
|
||||||
const [newPhotos, setNewPhotos] = useState<File[]>([]);
|
const [newPhotos, setNewPhotos] = useState<File[]>([]);
|
||||||
|
|
||||||
const adminUser = AuthService.getCurrentUser();
|
const { user: adminUser } = useAuth();
|
||||||
|
//const adminUser = AuthService.getCurrentUser();
|
||||||
const scrollRef = useRef<HTMLDivElement>(null);
|
const scrollRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
// 🟢 HELPER ROBUSTO PARA IDs: Busca en todas las variantes de casing posibles
|
// 🟢 HELPER ROBUSTO PARA IDs: Busca en todas las variantes de casing posibles
|
||||||
@@ -102,7 +104,7 @@ export default function ModerationModal({ adSummary, onClose, onApprove }: Props
|
|||||||
fetchData();
|
fetchData();
|
||||||
const interval = setInterval(loadChat, 5000);
|
const interval = setInterval(loadChat, 5000);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [adSummary, adminUser]);
|
}, [adSummary?.adID, adSummary?.AdID, adminUser?.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (scrollRef.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
if (scrollRef.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default function ExplorarPage() {
|
|||||||
|
|
||||||
fetchListings();
|
fetchListings();
|
||||||
if (showMobileFilters) setShowMobileFilters(false);
|
if (showMobileFilters) setShowMobileFilters(false);
|
||||||
}, [searchParams]);
|
}, [searchParams.toString()]);
|
||||||
|
|
||||||
const applyFilters = () => {
|
const applyFilters = () => {
|
||||||
const newParams = new URLSearchParams(searchParams);
|
const newParams = new URLSearchParams(searchParams);
|
||||||
|
|||||||
Reference in New Issue
Block a user