fix(frontend): full-page nav for auth links; land on home after login

- Add data-sveltekit-reload to the /login links so the browser performs a full
  navigation (the client router intercepted them and aborted on the external
  Zitadel redirect)
- Default post-login returnTo to / (home) since /explore is not built yet
- 'Empezar gratis' now starts the register flow (/login?mode=register)
This commit is contained in:
2026-07-05 23:16:25 +02:00
parent 5b2f402a9d
commit fe8c2c4244
5 changed files with 11 additions and 5 deletions
+2 -1
View File
@@ -45,7 +45,8 @@
<div class="mt-10 flex flex-wrap items-center justify-center gap-4">
<a
href="/login"
href="/login?mode=register"
data-sveltekit-reload
class="rounded-full bg-emerald-500 px-6 py-3 text-sm font-semibold text-neutral-950 transition hover:bg-emerald-400"
>
Empezar gratis
+1 -1
View File
@@ -16,7 +16,7 @@ export const GET: RequestHandler = async ({ url, cookies }) => {
const codeVerifier = cookies.get(VERIFIER_COOKIE);
const state = cookies.get(STATE_COOKIE);
const nonce = cookies.get(NONCE_COOKIE);
const returnTo = cookies.get(RETURN_COOKIE) ?? '/explore';
const returnTo = cookies.get(RETURN_COOKIE) ?? '/';
if (!codeVerifier || !state) {
error(400, 'Estado de autenticación inválido. Vuelve a iniciar sesión.');
+1 -1
View File
@@ -20,7 +20,7 @@ export const GET: RequestHandler = async ({ url, cookies }) => {
const nonce = client.randomNonce();
const register = url.searchParams.get('mode') === 'register';
const returnTo = url.searchParams.get('returnTo') ?? '/explore';
const returnTo = url.searchParams.get('returnTo') ?? '/';
const parameters: Record<string, string> = {
redirect_uri: authConfig.redirectUri,