fixed issue with login page.

This commit is contained in:
bobbert committed 2025-03-14 23:50:25 +00:00
1 parent 11fc5c8b3d
commit 84f010cb87
6 files changed
+153 -30

No files matched your search

+3 -8
View File
@@ -14,14 +14,9 @@ export default function Login() {
const { data: session, status } = useSession();
const searchParams = useSearchParams();
// Redirect if already authenticated
useEffect(() => {
if (status === "authenticated") {
const callbackUrl = searchParams.get("callbackUrl") || "/team-selection";
router.push(callbackUrl);
}
// Check for error param
// Removed redirection for authenticated users; do not auto-navigate away from login.
// Retain error handling from search params.
const errorParam = searchParams.get("error");
if (errorParam) {
if (errorParam === "AuthError") {
@@ -30,7 +25,7 @@ export default function Login() {
setError("Authentication failed. Please try again.");
}
}
}, [status, router, searchParams]);
}, [searchParams]);
const handleLogin = async (e) => {
e.preventDefault();