mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-03 16:43:45 +00:00
added signup and verify email forms
This commit is contained in:
17
src/app/auth/signup/page.tsx
Normal file
17
src/app/auth/signup/page.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import SignupForm from "@app/components/SignupForm";
|
||||
import { verifySession } from "@app/lib/verifySession";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page() {
|
||||
const user = await verifySession();
|
||||
|
||||
if (user) {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SignupForm />
|
||||
</>
|
||||
);
|
||||
}
|
||||
22
src/app/auth/verify-email/page.tsx
Normal file
22
src/app/auth/verify-email/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import VerifyEmailForm from "@app/components/VerifyEmailForm";
|
||||
import { verifySession } from "@app/lib/verifySession";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page() {
|
||||
const user = await verifySession();
|
||||
console.log(user)
|
||||
|
||||
if (!user) {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
if (user.emailVerified) {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<VerifyEmailForm email={user.email}/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user