first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
17
apps/web/app/(saas)/auth/forgot-password/page.tsx
Normal file
17
apps/web/app/(saas)/auth/forgot-password/page.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { ForgotPasswordForm } from "@saas/auth/components/ForgotPasswordForm";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
|
||||
return {
|
||||
title: t("auth.forgotPassword.title"),
|
||||
};
|
||||
}
|
||||
|
||||
export default function ForgotPasswordPage() {
|
||||
return <ForgotPasswordForm />;
|
||||
}
|
||||
14
apps/web/app/(saas)/auth/layout.tsx
Normal file
14
apps/web/app/(saas)/auth/layout.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { SessionProvider } from "@saas/auth/components/SessionProvider";
|
||||
import { AuthWrapper } from "@saas/shared/components/AuthWrapper";
|
||||
import type { PropsWithChildren } from "react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export default function AuthLayout({ children }: PropsWithChildren) {
|
||||
return (
|
||||
<SessionProvider>
|
||||
<AuthWrapper>{children}</AuthWrapper>
|
||||
</SessionProvider>
|
||||
);
|
||||
}
|
||||
17
apps/web/app/(saas)/auth/login/page.tsx
Normal file
17
apps/web/app/(saas)/auth/login/page.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { LoginForm } from "@saas/auth/components/LoginForm";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
|
||||
return {
|
||||
title: t("auth.login.title"),
|
||||
};
|
||||
}
|
||||
|
||||
export default function LoginPage() {
|
||||
return <LoginForm />;
|
||||
}
|
||||
17
apps/web/app/(saas)/auth/reset-password/page.tsx
Normal file
17
apps/web/app/(saas)/auth/reset-password/page.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { ResetPasswordForm } from "@saas/auth/components/ResetPasswordForm";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
|
||||
return {
|
||||
title: t("auth.resetPassword.title"),
|
||||
};
|
||||
}
|
||||
|
||||
export default function ResetPasswordPage() {
|
||||
return <ResetPasswordForm />;
|
||||
}
|
||||
48
apps/web/app/(saas)/auth/signup/page.tsx
Normal file
48
apps/web/app/(saas)/auth/signup/page.tsx
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { config } from "@repo/config";
|
||||
import { SignupForm } from "@saas/auth/components/SignupForm";
|
||||
import { getInvitation } from "@saas/auth/lib/server";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
import { withQuery } from "ufo";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
|
||||
return {
|
||||
title: t("auth.signup.title"),
|
||||
};
|
||||
}
|
||||
export default async function SignupPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{
|
||||
[key: string]: string | string[] | undefined;
|
||||
invitationId?: string;
|
||||
}>;
|
||||
}) {
|
||||
const params = await searchParams;
|
||||
const { invitationId } = params;
|
||||
|
||||
if (!(config.auth.enableSignup || invitationId)) {
|
||||
return redirect(withQuery("/auth/login", params));
|
||||
}
|
||||
|
||||
if (invitationId) {
|
||||
const invitation = await getInvitation(invitationId);
|
||||
|
||||
if (
|
||||
!invitation ||
|
||||
invitation.status !== "pending" ||
|
||||
invitation.expiresAt.getTime() < new Date().getTime()
|
||||
) {
|
||||
return redirect(withQuery("/auth/login", params));
|
||||
}
|
||||
|
||||
return <SignupForm prefillEmail={invitation.email} />;
|
||||
}
|
||||
|
||||
return <SignupForm />;
|
||||
}
|
||||
17
apps/web/app/(saas)/auth/verify/page.tsx
Normal file
17
apps/web/app/(saas)/auth/verify/page.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { OtpForm } from "@saas/auth/components/OtpForm";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
|
||||
return {
|
||||
title: t("auth.verify.title"),
|
||||
};
|
||||
}
|
||||
|
||||
export default function VerifyPage() {
|
||||
return <OtpForm />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue