-
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
1,668 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export function AuthPageContainer({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-8 lg:space-y-10">{children}</div>; | ||
} | ||
|
||
export function AuthPageHeader({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-1 text-center">{children}</div>; | ||
} | ||
|
||
export function AuthPageTitle({ children }: { children: React.ReactNode }) { | ||
return <h1 className="text-2xl font-bold">{children}</h1>; | ||
} | ||
|
||
export function AuthPageDescription({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <p className="text-muted-foreground">{children}</p>; | ||
} | ||
|
||
export function AuthPageContent({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-4">{children}</div>; | ||
} | ||
|
||
export function AuthPageExternal({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<p className="text-muted-foreground px-4 py-3 text-center">{children}</p> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,55 @@ | ||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
import { cn } from "@rallly/ui"; | ||
import { DotPattern } from "@rallly/ui/dot-pattern"; | ||
import type { Metadata } from "next"; | ||
|
||
import { Logo } from "@/components/logo"; | ||
import { isQuickCreateEnabled } from "@/features/quick-create"; | ||
import { QuickStartButton } from "@/features/quick-create/quick-create-button"; | ||
import { QuickStartWidget } from "@/features/quick-create/quick-create-widget"; | ||
|
||
export default async function Layout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<div className="h-full p-3 sm:p-8"> | ||
<div className="mx-auto max-w-lg">{children}</div> | ||
<div className="relative flex h-screen flex-col items-center justify-center bg-gray-100 p-2 lg:p-4"> | ||
<div className="z-10 flex w-full max-w-7xl flex-1 rounded-xl border bg-white shadow-sm lg:max-h-[720px] lg:p-2"> | ||
<div className="flex flex-1 flex-col gap-4 p-6 lg:p-16"> | ||
<div className="py-8"> | ||
<Logo className="mx-auto" /> | ||
</div> | ||
<div className="flex h-full w-full flex-1 flex-col items-center justify-center"> | ||
<div className="w-full max-w-sm">{children}</div> | ||
</div> | ||
{isQuickCreateEnabled ? ( | ||
<div className="flex justify-center lg:hidden"> | ||
<QuickStartButton /> | ||
</div> | ||
) : null} | ||
</div> | ||
{isQuickCreateEnabled ? ( | ||
<div className="relative hidden flex-1 flex-col justify-center rounded-lg border border-gray-100 bg-gray-50 lg:flex lg:p-16"> | ||
<div className="z-10 mx-auto w-full max-w-md"> | ||
<QuickStartWidget /> | ||
</div> | ||
<DotPattern | ||
cx={10} | ||
cy={10} | ||
className={cn( | ||
"[mask-image:radial-gradient(400px_circle_at_top,white,transparent)]", | ||
)} | ||
/> | ||
</div> | ||
) : null} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const metadata: Metadata = { | ||
title: { | ||
template: "%s - Rallly", | ||
default: "Rallly", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use server"; | ||
|
||
import { prisma } from "@rallly/database"; | ||
import { cookies } from "next/headers"; | ||
|
||
export async function setVerificationEmail(email: string) { | ||
const count = await prisma.user.count({ | ||
where: { | ||
email, | ||
}, | ||
}); | ||
|
||
cookies().set("verification-email", email, { | ||
httpOnly: true, | ||
secure: process.env.NODE_ENV === "production", | ||
sameSite: "lax", | ||
maxAge: 15 * 60, | ||
}); | ||
|
||
return count > 0; | ||
} |
21 changes: 21 additions & 0 deletions
21
apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client"; | ||
import { useSearchParams } from "next/navigation"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export function AuthErrors() { | ||
const { t } = useTranslation(); | ||
const searchParams = useSearchParams(); | ||
const error = searchParams?.get("error"); | ||
if (error === "OAuthAccountNotLinked") { | ||
return ( | ||
<p className="text-destructive text-sm"> | ||
{t("accountNotLinkedDescription", { | ||
defaultValue: | ||
"A user with this email already exists. Please log in using the original method.", | ||
})} | ||
</p> | ||
); | ||
} | ||
|
||
return null; | ||
} |
Oops, something went wrong.