Recuperar implementado
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user