refacto(db): remove localstorage service
This commit is contained in:
@@ -17,16 +17,6 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
|
||||
// Vérification de l'authentification
|
||||
useEffect(() => {
|
||||
const isPublicRoute = publicRoutes.includes(pathname);
|
||||
const isAuthenticated = authService.isAuthenticated();
|
||||
|
||||
if (!isAuthenticated && !isPublicRoute) {
|
||||
router.push(`/login?from=${encodeURIComponent(pathname)}`);
|
||||
}
|
||||
}, [pathname, router]);
|
||||
|
||||
const handleCloseSidebar = () => {
|
||||
setIsSidebarOpen(false);
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@ import { cn } from "@/lib/utils";
|
||||
import { authService } from "@/lib/services/auth.service";
|
||||
import { useEffect, useState, useCallback } from "react";
|
||||
import { KomgaLibrary, KomgaSeries } from "@/types/komga";
|
||||
import { storageService } from "@/lib/services/storage.service";
|
||||
|
||||
interface SidebarProps {
|
||||
isOpen: boolean;
|
||||
@@ -99,7 +98,6 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
|
||||
const handleLogout = () => {
|
||||
authService.logout();
|
||||
storageService.clearAll();
|
||||
setLibraries([]);
|
||||
setFavorites([]);
|
||||
onClose();
|
||||
|
||||
Reference in New Issue
Block a user