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

set redirectUrl on auth routes#183

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

set redirectUrl on auth routes#183
narthur merged 2 commits intomasterfrom
login-register-paths

Conversation

@narthur
Copy link
Collaborator

@narthur narthur commented Sep 29, 2025

Currently visiting /login and /register results in a redirect loop since clerk redirects back to /login and /register. This explicitly sets redirect urls on these routes to avoid the loop.

Summary by CodeRabbit

  • Bug Fixes
    • Standardized post-authentication redirects: after login or registration, users are now returned to the homepage for a consistent experience.
    • Prevents unexpected landing on unintended pages following authentication-related redirects, improving navigation flow and predictability.

@narthur narthur temporarily deployed to login-register-paths - tr-web PR #183 September 29, 2025 18:31 — with Render Destroyed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Updated src/App.tsx to modify the /login and /register routes so they render RedirectToSignIn and RedirectToSignUp with an explicit redirectUrl of '/'.

Changes

Cohort / File(s) Summary
Auth routing updates
src/App.tsx
Passes redirectUrl='/' to RedirectToSignIn and RedirectToSignUp; reformats related Route elements to multi-line.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

I hop through routes with whiskers keen,
A gentle nudge to sign-in screen.
With one swift leap—redirect, hooray!
Back to “/” I’m on my way.
Carrots cached, auth paths tidy—yay! 🥕✨

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 describes the primary change by stating that redirectUrl is being set on authentication routes, which matches the modifications in App.tsx to pass redirectUrl props and resolves the redirect loop issue.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 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 a74d9bf and 5b7cf2b.

📒 Files selected for processing (1)
  • src/App.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/App.tsx (1)
__mocks__/@clerk/clerk-react.tsx (2)
  • RedirectToSignIn (11-13)
  • RedirectToSignUp (15-17)
🔇 Additional comments (1)
src/App.tsx (1)

125-133: Explicit redirect breaks the loop cleanly.

Setting redirectUrl="/" on both Clerk redirects gives them a safe landing page and prevents the /login or /register bounce-back you described. Nice tidy fix.


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         │
└────────────────────────────────────────┴─────────────────┴───────────────┘

@narthur narthur temporarily deployed to login-register-paths - tr-web PR #183 September 29, 2025 18:32 — with Render Destroyed
@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 (+260 B) +0.01%
Changeset
File Δ Size
src/App.tsx 📈 +260 B (+5.59%) 4.55 kB → 4.8 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
assets/index.js 492.39 kB → 492.64 kB (+260 B) +0.05%

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%

@narthur narthur merged commit 1bc9fcb into master Sep 29, 2025
13 of 14 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