-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ New Login Page #1504
✨ New Login Page #1504
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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> | ||
); | ||
} |
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 ( | ||
Comment on lines
+10
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Remove unnecessary async keyword The layout component doesn't perform any asynchronous operations. It's a purely presentational component that renders static JSX with UI components and styling. The async keyword can be safely removed. 🔗 Analysis chainVerify the necessity of the async keyword. The component is marked as async but doesn't appear to perform any asynchronous operations. If there are no server-side data fetches or async operations planned, consider removing the async keyword. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any async operations or data fetches in related auth files
rg -l "fetch|await" "apps/web/src/app/\[locale\]/\(auth\)/"
Length of output: 139 Script: #!/bin/bash
# First, find auth-related files
fd -t f . apps/web/src/app | grep -i "auth"
# Then search for async/await usage in the layout file specifically
fd "layout.tsx" apps/web/src/app | grep -i "auth" | xargs rg "async|await|fetch" -A 3
Length of output: 1535 Script: #!/bin/bash
# Check imports and content of the auth layout
rg -A 10 "^import|'use server'" "apps/web/src/app/[locale]/(auth)/layout.tsx" || true
# Check for server actions in auth-related action files
rg -A 5 "'use server'" "apps/web/src/app/[locale]/(auth)/login/actions.ts" "apps/web/src/app/[locale]/(auth)/register/actions.ts" || true
Length of output: 1012 |
||
<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", | ||
}, | ||
}; |
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; | ||
} |
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for failed magic link authentication.
The magic link fetch doesn't handle network errors or invalid responses.
Add error handling: