Recuperar implementado
This commit is contained in:
@@ -17,13 +17,13 @@
|
||||
});
|
||||
|
||||
// Guard reactivo global: redirige a /login si no está autenticado en rutas protegidas
|
||||
const publicRoutes = ['/login', '/register', '/forgot-password', '/reset-password'];
|
||||
$: if (browser && mounted && !$auth.isAuthenticated &&
|
||||
!$page.url.pathname.startsWith('/login') &&
|
||||
!$page.url.pathname.startsWith('/register')) {
|
||||
!publicRoutes.some(r => $page.url.pathname.startsWith(r))) {
|
||||
goto('/login');
|
||||
}
|
||||
|
||||
$: showHeader = !$page.url.pathname.startsWith('/login') && !$page.url.pathname.startsWith('/register');
|
||||
$: showHeader = !publicRoutes.some(r => $page.url.pathname.startsWith(r));
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen bg-gray-50 font-sans">
|
||||
|
||||
Reference in New Issue
Block a user