Skip to content

Commit 5988a81

Browse files
Merge pull request #86 from priyansh-narang2308/fix/home-navigation-and-auth-redirect
[WOC] Fix: Prevent unintended navigation to landing page and improve authenticated user flow
2 parents 0cf6bbd + 7fa8e3b commit 5988a81

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/auth/page.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
import Image from "next/image";
44
import Link from "next/link";
5-
import { useState } from "react";
5+
import { useEffect, useState } from "react";
66
import { env } from "next-runtime-env";
77

88
export default function Auth() {
9+
useEffect(() => {
10+
if (localStorage.getItem("id")) {
11+
window.location.href = "/create";
12+
}
13+
}, []);
914
const [email, setEmail] = useState("");
1015
const [password, setPassword] = useState("");
1116
const [isLoading, setIsLoading] = useState(false);

0 commit comments

Comments
 (0)