mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-09-21 04:20:37 +02:00
22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import { useRouter } from "next/router";
|
|
import React, { useContext } from "react";
|
|
import AuthForm from "../../components/auth/AuthForm";
|
|
import Meta from "../../components/Meta";
|
|
import { IsSignedInContext } from "../../utils/auth.util";
|
|
|
|
const SignIn = () => {
|
|
const isSignedIn = useContext(IsSignedInContext);
|
|
const router = useRouter();
|
|
if (isSignedIn) {
|
|
router.replace("/");
|
|
} else {
|
|
return (
|
|
<>
|
|
<Meta title="Sign In" />
|
|
<AuthForm mode="signIn" />
|
|
</>
|
|
);
|
|
}
|
|
};
|
|
export default SignIn;
|