mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-05 09:29:27 +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}/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { Roboto } from "next/font/google";
|
||||
import { Toaster } from "@/components/ui/toaster"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: process.env.NEXT_PUBLIC_APP_NAME,
|
||||
@@ -18,6 +19,7 @@ export default async function RootLayout({
|
||||
<html>
|
||||
<body className={`${font.className}`}>
|
||||
<main>{children}</main>
|
||||
<Toaster />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user