Adjust routing: show login page, redirect after successful auth; OAuth returns to login
cgen-1fddf1bb6b9042ecaf51edccfb75f069
This commit is contained in:
parent
9d8d6da61b
commit
a4509d2e90
1 changed files with 6 additions and 2 deletions
|
|
@ -39,9 +39,13 @@ export default function Login() {
|
|||
// Redirect if already logged in
|
||||
useEffect(() => {
|
||||
if (user && !loading) {
|
||||
navigate("/onboarding", { replace: true });
|
||||
if (profile) {
|
||||
navigate("/dashboard", { replace: true });
|
||||
} else {
|
||||
navigate("/onboarding", { replace: true });
|
||||
}
|
||||
}
|
||||
}, [user, loading, navigate]);
|
||||
}, [user, profile, loading, navigate]);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
|
|
|||
Loading…
Reference in a new issue