Add login redirection for feedback actions: Ensure users are redirected to the login page if they attempt to provide feedback without being authenticated, enhancing user experience and security.

This commit is contained in:
Julien Froidefond
2025-12-11 07:45:46 +01:00
parent 6c08789555
commit 93c6624aec

View File

@@ -502,6 +502,10 @@ export default function EventsPageSection({
<button
onClick={(e) => {
e.stopPropagation();
if (!session?.user?.id) {
router.push("/login");
return;
}
setFeedbackEventId(event.id);
}}
className="w-full px-4 py-2 border border-pixel-gold/50 bg-black/40 text-white uppercase text-xs tracking-widest rounded hover:bg-pixel-gold/10 hover:border-pixel-gold transition"
@@ -822,6 +826,11 @@ export default function EventsPageSection({
<button
onClick={(e) => {
e.stopPropagation();
if (!session?.user?.id) {
router.push("/login");
setSelectedEvent(null);
return;
}
setFeedbackEventId(selectedEvent.id);
setSelectedEvent(null);
}}