generated from michellepace/nextjs-base
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Clerk authentication with E2E tests #7
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
87d31ec
docs: standardise figma asset naming and add layout reference
michellepace c8135fa
feat: add route groups for auth and root with separate layouts
michellepace 407cb22
checkpoint: before clerk installation
michellepace 01397d1
feat: add Clerk authentication and apply security updates
michellepace e7a608e
fix: wrap ClerkProvider in Suspense boundary for Next.js 16 PPR
michellepace 0cc014e
test: add auth smoke test with Clerk E2E testing integration
michellepace f4f0b3a
fix: use connection() to force dynamic rendering on Clerk auth pages
michellepace 844d21e
chore: trigger Vercel rebuild with env var fix
michellepace e26fad6
chore: trigger fresh E2E run
michellepace f773999
rules: rename coderabbit output file and clarify location
michellepace e5adbee
style: coderabbit | add aria-hidden to decorative icons and use absol…
michellepace dbac04c
fix: use NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY for Next.js build
michellepace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -40,3 +40,6 @@ next-env.d.ts | |
| # Playwright | ||
| .playwright/ | ||
| .playwright-mcp/ | ||
|
|
||
| # Temporary docs | ||
| x_docs/temp/ | ||
This file contains hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
| const AuthLayout = ({ children }: { children: React.ReactNode }) => { | ||
| return ( | ||
| <main className="min-h-screen bg-cover bg-center bg-no-repeat bg-[url('/images/auth-bg-light.webp')] dark:bg-[url('/images/auth-bg-dark.webp')]"> | ||
| {children} | ||
| </main> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthLayout; |
This file contains hidden or 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,12 @@ | ||
| import { SignIn } from "@clerk/nextjs"; | ||
| import { connection } from "next/server"; | ||
|
|
||
| export default async function SignInPage() { | ||
| await connection(); | ||
|
|
||
| return ( | ||
| <div className="flex min-h-screen items-center justify-center p-6"> | ||
| <SignIn /> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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,57 @@ | ||
| import { SignUp } from "@clerk/nextjs"; | ||
| import { ChartLine, Clock, ShieldCheck, Sparkles } from "lucide-react"; | ||
| import { connection } from "next/server"; | ||
|
|
||
| export default async function SignUpPage() { | ||
| await connection(); | ||
| return ( | ||
| <div className="grid min-h-screen lg:grid-cols-2"> | ||
| <div className="hidden flex-1 items-center justify-end p-6 md:p-10 lg:flex"> | ||
| <ul className="max-w-sm space-y-8"> | ||
| <li> | ||
| <div className="flex items-center gap-2"> | ||
| <Clock className="size-4" aria-hidden="true" /> | ||
| <p className="font-semibold">Save on development time</p> | ||
| </div> | ||
| <p className="text-muted-foreground mt-2 text-sm"> | ||
| Add authentication and user management to your app with just a few | ||
| lines of code. | ||
| </p> | ||
| </li> | ||
| <li> | ||
| <div className="flex items-center gap-2"> | ||
| <ChartLine className="size-4" aria-hidden="true" /> | ||
| <p className="font-semibold">Increase engagement</p> | ||
| </div> | ||
| <p className="text-muted-foreground mt-2 text-sm"> | ||
| Add intuitive UIs designed to decrease friction for your users. | ||
| </p> | ||
| </li> | ||
| <li> | ||
| <div className="flex items-center gap-2"> | ||
| <ShieldCheck className="size-4" aria-hidden="true" /> | ||
| <p className="font-semibold">Protect your users</p> | ||
| </div> | ||
| <p className="text-muted-foreground mt-2 text-sm"> | ||
| Enable features like two-step verification and enjoy automatic | ||
| security updates. | ||
| </p> | ||
| </li> | ||
| <li> | ||
| <div className="flex items-center gap-2"> | ||
| <Sparkles className="size-4" aria-hidden="true" /> | ||
| <p className="font-semibold">Match your brand</p> | ||
| </div> | ||
| <p className="text-muted-foreground mt-2 text-sm"> | ||
| Theme our pre-built components, or integrate with our easy-to-use | ||
| APIs. | ||
| </p> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| <div className="flex flex-1 items-center justify-center p-6 md:p-10 lg:justify-start"> | ||
| <SignUp /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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,12 @@ | ||
| import { Navbar } from "@/components/navigation/navbar"; | ||
|
|
||
| const RootLayout = ({ children }: { children: React.ReactNode }) => { | ||
| return ( | ||
| <> | ||
| <Navbar /> | ||
| {children} | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default RootLayout; |
File renamed without changes.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: michellepace/devflow
Length of output: 128
🏁 Script executed:
Repository: michellepace/devflow
Length of output: 1848
🌐 Web query:
Next.js 16 root layout Suspense html body top-level requirements💡 Result:
Short answer — in Next.js (App Router / root layout):
If you want examples (root layout with Suspense or wrapping in Suspense), tell me and I’ll show a minimal code sample.
Citations:
🌐 Web query:
Next.js 16 root layout Suspense inside body ClerkProvider valid💡 Result:
Short answer: Yes — you can put a React Suspense boundary inside the of your Next.js 16 root layout, and you can wrap your app with ClerkProvider there — but you must respect server/client component rules.
Key points and recommended patterns
Practical guidance
Sources
If you want, tell me whether you’re using Clerk’s latest package and I’ll show the exact minimal wrapper/layout code for your setup.
🏁 Script executed:
Repository: michellepace/devflow
Length of output: 95
🏁 Script executed:
Repository: michellepace/devflow
Length of output: 684
Move
<Suspense>inside<body>to maintain proper root layout structureNext.js root layouts must return
<html>and<body>as the top-level elements. Currently,<Suspense>wraps these tags, which violates this requirement and may cause validation errors or build failures.Restructure to keep
<html>/<body>at the root while wrappingClerkProviderand nested content inSuspense:📝 Committable suggestion