Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd3d7e816f |
@@ -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">
|
||||
|
||||
@@ -216,12 +216,13 @@
|
||||
>Recordar en este equipo</label
|
||||
>
|
||||
</div>
|
||||
<a
|
||||
href="/forgot-password"
|
||||
class="text-sm font-medium text-blue-600 hover:text-blue-500"
|
||||
<button
|
||||
type="button"
|
||||
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
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user