2022-04-25 15:15:17 +02:00
|
|
|
import { useRouter } from "next/router";
|
|
|
|
import AuthForm from "../../components/auth/AuthForm";
|
2022-04-28 15:31:37 +02:00
|
|
|
import Meta from "../../components/Meta";
|
2022-10-09 22:30:32 +02:00
|
|
|
import useUser from "../../hooks/user.hook";
|
2022-04-25 15:15:17 +02:00
|
|
|
|
|
|
|
const SignIn = () => {
|
2022-10-09 22:30:32 +02:00
|
|
|
const user = useUser();
|
2022-04-25 15:15:17 +02:00
|
|
|
const router = useRouter();
|
2022-10-09 22:30:32 +02:00
|
|
|
if (user) {
|
2022-04-25 15:15:17 +02:00
|
|
|
router.replace("/");
|
|
|
|
} else {
|
2022-04-28 15:31:37 +02:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Meta title="Sign In" />
|
|
|
|
<AuthForm mode="signIn" />
|
|
|
|
</>
|
|
|
|
);
|
2022-04-25 15:15:17 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
export default SignIn;
|