Compare commits

..

1 Commits

Author SHA1 Message Date
cd3d7e816f Recuperar implementado 2026-02-27 10:08:30 -07:00
2 changed files with 8 additions and 7 deletions

View File

@@ -17,13 +17,13 @@
}); });
// Guard reactivo global: redirige a /login si no está autenticado en rutas protegidas // 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 && $: if (browser && mounted && !$auth.isAuthenticated &&
!$page.url.pathname.startsWith('/login') && !publicRoutes.some(r => $page.url.pathname.startsWith(r))) {
!$page.url.pathname.startsWith('/register')) {
goto('/login'); goto('/login');
} }
$: showHeader = !$page.url.pathname.startsWith('/login') && !$page.url.pathname.startsWith('/register'); $: showHeader = !publicRoutes.some(r => $page.url.pathname.startsWith(r));
</script> </script>
<div class="min-h-screen bg-gray-50 font-sans"> <div class="min-h-screen bg-gray-50 font-sans">

View File

@@ -216,12 +216,13 @@
>Recordar en este equipo</label >Recordar en este equipo</label
> >
</div> </div>
<a <button
href="/forgot-password" type="button"
class="text-sm font-medium text-blue-600 hover:text-blue-500" class="text-sm font-medium text-blue-600 hover:text-blue-500 bg-transparent border-none p-0 cursor-pointer"
on:click={() => goto('/forgot-password')}
> >
Olvide mi clave Olvide mi clave
</a> </button>
</div> </div>
</div> </div>
{:else} {:else}