Skip to content

added clerk auth#1

Merged
Srijan76-code merged 1 commit into
mainfrom
srijan_Clerk
Oct 4, 2025
Merged

added clerk auth#1
Srijan76-code merged 1 commit into
mainfrom
srijan_Clerk

Conversation

@Srijan76-code
Copy link
Copy Markdown
Owner

@Srijan76-code Srijan76-code commented Oct 4, 2025

Summary by CodeRabbit

  • New Features
    • Introduced app-wide authentication using Clerk.
    • Added dedicated Sign In and Sign Up pages with Clerk’s UI.
    • Enabled automatic protection of non-public routes; unauthenticated users are redirected to sign in.
  • Chores
    • Added Clerk dependency to the project.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Integrated Clerk authentication by wrapping the app with ClerkProvider, adding sign-in and sign-up routes, configuring middleware to protect non-public routes, and adding the @clerk/nextjs dependency.

Changes

Cohort / File(s) Summary
Auth provider integration
app/layout.js, middleware.js
Wrapped RootLayout with ClerkProvider. Added Clerk middleware with public route matcher for /sign-in* and /sign-up*, protecting all other routes; exported config.matcher for routing.
Auth pages
app/sign-in/[[...sign-in]]/page.jsx, app/sign-up/[[...sign-up]]/page.jsx
Added pages rendering Clerk <SignIn /> and <SignUp /> components with default-exported Page functions.
Dependencies
package.json
Added dependency @clerk/nextjs@^6.33.2.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant B as Browser
  participant M as Next.js Middleware (Clerk)
  participant A as Next.js App Router
  participant C as Clerk Service

  U->>B: Navigate to route
  B->>M: Request
  alt Public route (/sign-in*, /sign-up*)
    M-->>B: Allow
    B->>A: Render SignIn/SignUp page
    A->>C: Load Clerk UI assets/context
    C-->>A: UI ready
    A-->>B: Page HTML
  else Protected route
    M->>C: Check session
    alt Authenticated
      M-->>B: Allow
      B->>A: Render protected page
      A-->>B: Page HTML
    else Unauthenticated
      M-->>B: Redirect to /sign-in
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws—access aligned,
Keys from Clerk now neatly signed.
Doors swing wide for sign-up cheer,
Guards stand firm when secrets near.
Hop, hop, hop—routes safe and bright,
Carrots secured, I sleep tonight. 🥕✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch srijan_Clerk

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82ce77c and f9b42b9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • app/layout.js (2 hunks)
  • app/sign-in/[[...sign-in]]/page.jsx (1 hunks)
  • app/sign-up/[[...sign-up]]/page.jsx (1 hunks)
  • middleware.js (1 hunks)
  • package.json (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Srijan76-code Srijan76-code merged commit 586715f into main Oct 4, 2025
1 check was pending
This was referenced Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant