Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Add redirects for /login and /register paths to Clerk auth pages#180

Merged
narthur merged 2 commits intomasterfrom
login-register-paths
Sep 29, 2025
Merged

Add redirects for /login and /register paths to Clerk auth pages#180
narthur merged 2 commits intomasterfrom
login-register-paths

Conversation

@narthur
Copy link
Collaborator

@narthur narthur commented Sep 29, 2025

There are still links to /login and /register, so we can't actually remove them entirely. Instead we need to set them up to redirect to Clerk login and register pages. This PR makes the change.

Summary by CodeRabbit

  • New Features
    • Added dedicated /login and /register routes that automatically redirect users to sign-in and sign-up flows.
    • Smoother authentication onboarding with consistent routing for sign-in and sign-up.
    • Deep-linkable authentication endpoints for direct access from emails, bookmarks, or shared links.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Added Clerk redirect components and routes: imported RedirectToSignIn and RedirectToSignUp into src/App.tsx, added /login and /register routes that render those components, and added a matching mock export in __mocks__/@clerk/clerk-react.tsx.

Changes

Cohort / File(s) Summary
App routing and Clerk imports
src/App.tsx
Imported RedirectToSignIn and RedirectToSignUp from @clerk/clerk-react; added /login and /register routes that render those components.
Clerk mock exports
__mocks__/@clerk/clerk-react.tsx
Added export RedirectToSignUp(): JSX.Element (mock) alongside existing RedirectToSignIn mock to mirror new imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through code with glee,
Adds two routes for sign-in, sign-up spree.
Redirects guide each user’s way,
Smooth as carrots on a sunny day. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by stating that the /login and /register routes now redirect to Clerk authentication pages, directly reflecting the added routing and imports in the pull request.
✨ Finishing touches
  • 📝 Docstrings were successfully generated. (🔄 Check again to generate docstrings again)
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch login-register-paths

📜 Recent review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74eef99 and 0996f59.

📒 Files selected for processing (1)
  • __mocks__/@clerk/clerk-react.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: global-setup.ts:25-25
Timestamp: 2025-08-12T21:38:27.063Z
Learning: The project uses __mocks__/clerk/clerk-react.tsx to provide mock implementations for Clerk authentication components and hooks instead of inline mocking in global-setup.ts. The mock file exports ClerkProvider, Protect, RedirectToSignIn, SignedIn, UserButton components and useUser/useClerk hooks with test-friendly return values.
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: src/components/organisms/NavBar.tsx:40-49
Timestamp: 2025-08-16T19:53:45.147Z
Learning: In the TaskRatchet project, NavBar.spec.tsx still uses the old useSession mock and doesn't test the new Clerk authentication integration with useUser and useClerk hooks, so tests pass even when the Clerk mock returns session: null.
📚 Learning: 2025-08-12T21:38:27.063Z
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: global-setup.ts:25-25
Timestamp: 2025-08-12T21:38:27.063Z
Learning: The project uses __mocks__/clerk/clerk-react.tsx to provide mock implementations for Clerk authentication components and hooks instead of inline mocking in global-setup.ts. The mock file exports ClerkProvider, Protect, RedirectToSignIn, SignedIn, UserButton components and useUser/useClerk hooks with test-friendly return values.

Applied to files:

  • __mocks__/@clerk/clerk-react.tsx
📚 Learning: 2025-08-16T19:53:45.147Z
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: src/components/organisms/NavBar.tsx:40-49
Timestamp: 2025-08-16T19:53:45.147Z
Learning: In the TaskRatchet project, NavBar.spec.tsx still uses the old useSession mock and doesn't test the new Clerk authentication integration with useUser and useClerk hooks, so tests pass even when the Clerk mock returns session: null.

Applied to files:

  • __mocks__/@clerk/clerk-react.tsx

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

@github-actions
Copy link

github-actions bot commented Sep 29, 2025

Outdated dependencies

┌────────────────────────────────────────┬─────────────────┬───────────────┐
│ Package                                │ Current         │ Latest        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @clerk/themes                          │ 2.4.7           │ 2.4.22        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ dayjs                                  │ 1.11.13         │ 1.11.18       │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ humanize-duration                      │ 3.33.0          │ 3.33.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vite (dev)                             │ 7.1.2           │ 7.1.7         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @clerk/clerk-react                     │ 5.41.0          │ 5.49.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @eslint/compat (dev)                   │ 1.3.2           │ 1.4.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @eslint/js (dev)                       │ 9.33.0          │ 9.36.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @stripe/stripe-js                      │ 7.8.0           │ 7.9.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @testing-library/jest-dom (dev)        │ 6.6.4           │ 6.8.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @typescript-eslint/eslint-plugin (dev) │ 8.39.1          │ 8.45.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @typescript-eslint/parser (dev)        │ 8.39.1          │ 8.45.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ eslint (dev)                           │ 9.33.0          │ 9.36.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ knip (dev)                             │ 5.62.0          │ 5.64.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ prettier (dev)                         │ 3.3.3           │ 3.6.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ query-string                           │ 9.2.2           │ 9.3.1         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/icons-material                    │ 5.18.0          │ 7.3.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/material                          │ 5.18.0          │ 7.3.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/x-date-pickers                    │ 7.29.4          │ 8.12.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/node (dev)                      │ 22.17.1         │ 24.5.2        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/react (dev)                     │ 18.3.23         │ 19.1.15       │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/react-dom (dev)                 │ 18.3.7          │ 19.1.9        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @vitest/ui (dev)                       │ 2.1.9           │ 3.2.4         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ eslint-plugin-testing-library (dev)    │ 6.5.0           │ 7.11.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ globals (dev)                          │ 15.15.0         │ 16.4.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ jsdom (dev)                            │ 24.1.3          │ 27.0.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react                                  │ 18.3.1          │ 19.1.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-dom                              │ 18.3.1          │ 19.1.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-router-dom                       │ 6.30.1          │ 7.9.3         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-toastify                         │ 10.0.6          │ 11.0.5        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ rollup-plugin-visualizer (dev)         │ 5.14.0          │ 6.0.3         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ type-fest (dev)                        │ 4.41.0          │ 5.0.1         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vitest (dev)                           │ 2.1.9           │ 3.2.4         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/lab                               │ 5.0.0-alpha.173 │ 7.0.0-beta.17 │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vitest-fetch-mock (dev)                │ 0.3.0           │ 0.4.5         │
└────────────────────────────────────────┴─────────────────┴───────────────┘

@github-actions
Copy link

github-actions bot commented Sep 29, 2025

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
5 1.75 MB → 1.75 MB (+330 B) +0.02%
Changeset
File Δ Size
src/App.tsx 📈 +307 B (+7.06%) 4.25 kB → 4.55 kB
node_modules/@clerk/clerk-react/dist/chunk-WXC6AKVT.mjs 📈 +23 B (+0.74%) 3.02 kB → 3.04 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
assets/index.js 492.07 kB → 492.39 kB (+330 B) +0.07%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
assets/dom.js 144.67 kB 0%
assets/material.js 636.95 kB 0%
assets/diffToNow.js 55.09 kB 0%
assets/DueForm.js 465.88 kB 0%

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25b51bb and 74eef99.

📒 Files selected for processing (1)
  • src/App.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: global-setup.ts:25-25
Timestamp: 2025-08-12T21:38:27.063Z
Learning: The project uses __mocks__/clerk/clerk-react.tsx to provide mock implementations for Clerk authentication components and hooks instead of inline mocking in global-setup.ts. The mock file exports ClerkProvider, Protect, RedirectToSignIn, SignedIn, UserButton components and useUser/useClerk hooks with test-friendly return values.
📚 Learning: 2025-08-12T21:38:27.063Z
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: global-setup.ts:25-25
Timestamp: 2025-08-12T21:38:27.063Z
Learning: The project uses __mocks__/clerk/clerk-react.tsx to provide mock implementations for Clerk authentication components and hooks instead of inline mocking in global-setup.ts. The mock file exports ClerkProvider, Protect, RedirectToSignIn, SignedIn, UserButton components and useUser/useClerk hooks with test-friendly return values.

Applied to files:

  • src/App.tsx
📚 Learning: 2025-08-16T19:53:45.147Z
Learnt from: narthur
PR: TaskRatchet/taskratchet-web#166
File: src/components/organisms/NavBar.tsx:40-49
Timestamp: 2025-08-16T19:53:45.147Z
Learning: In the TaskRatchet project, NavBar.spec.tsx still uses the old useSession mock and doesn't test the new Clerk authentication integration with useUser and useClerk hooks, so tests pass even when the Clerk mock returns session: null.

Applied to files:

  • src/App.tsx
🧬 Code graph analysis (1)
src/App.tsx (1)
__mocks__/@clerk/clerk-react.tsx (1)
  • RedirectToSignIn (11-13)

@narthur narthur temporarily deployed to login-register-paths - tr-web PR #180 September 29, 2025 18:15 — with Render Destroyed
coderabbitai bot added a commit that referenced this pull request Sep 29, 2025
Docstrings generation was requested by @narthur.

* #180 (comment)

The following files were modified:

* `__mocks__/@clerk/clerk-react.tsx`
* `src/App.tsx`
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Note

Generated docstrings for this pull request at #181

@narthur narthur merged commit 067a791 into master Sep 29, 2025
14 of 15 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant