feat: remove appwrite and add nextjs backend

This commit is contained in:
Elias Schneider
2022-10-09 22:30:32 +02:00
parent 7728351158
commit 4bab33ad8a
153 changed files with 13400 additions and 2811 deletions

View File

@@ -0,0 +1,20 @@
import { useRouter } from "next/router";
import AuthForm from "../../components/auth/AuthForm";
import Meta from "../../components/Meta";
import useUser from "../../hooks/user.hook";
const SignIn = () => {
const user = useUser();
const router = useRouter();
if (user) {
router.replace("/");
} else {
return (
<>
<Meta title="Sign In" />
<AuthForm mode="signIn" />
</>
);
}
};
export default SignIn;

View File

@@ -0,0 +1,22 @@
import { useRouter } from "next/router";
import AuthForm from "../../components/auth/AuthForm";
import Meta from "../../components/Meta";
import useUser from "../../hooks/user.hook";
const SignUp = () => {
const user = useUser();
const router = useRouter();
if (user) {
router.replace("/");
} else if (process.env.NEXT_PUBLIC_DISABLE_REGISTRATION) {
router.replace("/auth/signIn");
} else {
return (
<>
<Meta title="Sign Up" />
<AuthForm mode="signUp" />
</>
);
}
};
export default SignUp;