fix(auth): centralize redirect path storage

This commit is contained in:
너이름 2026-05-11 06:30:26 +09:00
parent c8374e6c5b
commit fb0c13911d
3 changed files with 14 additions and 5 deletions

View file

@ -8,6 +8,7 @@ import { toast } from "sonner";
import { Logo } from "@/components/Logo";
import { useGlobalLoadingEffect } from "@/hooks/use-global-loading";
import { getAuthErrorDetails, shouldRetry } from "@/lib/auth-errors";
import { setRedirectPath } from "@/lib/auth-utils";
import { AUTH_TYPE } from "@/lib/env-config";
import { AmbientBackground } from "./AmbientBackground";
import { GoogleLoginButton } from "./GoogleLoginButton";
@ -33,7 +34,7 @@ function LoginContent() {
// Save returnUrl to localStorage so it persists through OAuth flows (e.g., Google)
// This is read by TokenHandler after successful authentication
if (returnUrl) {
localStorage.setItem("surfsense_redirect_path", decodeURIComponent(returnUrl));
setRedirectPath(decodeURIComponent(returnUrl));
}
// Show registration success message