feat: Enhance JWT authentication error logging, gate notification fetching by user status, and enable Rust debug logging in Docker Compose.

This commit is contained in:
2026-02-15 15:10:42 -03:00
parent 2a16a18676
commit 6927ac2d23
5 changed files with 16 additions and 7 deletions
@@ -2,6 +2,7 @@
import { useState, useEffect } from "react";
import { lmsApi, Notification } from "@/lib/api";
import { useAuth } from "@/context/AuthContext";
import { Bell, X, Calendar, Info, AlertTriangle, CheckCircle2 } from "lucide-react";
import Link from "next/link";
@@ -10,7 +11,10 @@ export default function NotificationCenter() {
const [isOpen, setIsOpen] = useState(false);
const [loading, setLoading] = useState(false);
const { user } = useAuth();
const fetchNotifications = async () => {
if (!user) return;
setLoading(true);
try {
const data = await lmsApi.getNotifications();
@@ -23,11 +27,13 @@ export default function NotificationCenter() {
};
useEffect(() => {
fetchNotifications();
// Poll every 5 minutes
const interval = setInterval(fetchNotifications, 300000);
return () => clearInterval(interval);
}, []);
if (user) {
fetchNotifications();
// Poll every 5 minutes
const interval = setInterval(fetchNotifications, 300000);
return () => clearInterval(interval);
}
}, [user]);
const markAsRead = async (id: string) => {
try {