Repository navigation
Reapply "test(docs): redirect" (#41439) - #41440
Conversation
This reverts commit c0137e9.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
WalkthroughA redirect configuration change in the documentation site replaces a specific auth-helpers route with a generalized wildcard pattern. The new rule matches any path under Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes This is a straightforward configuration change affecting a single redirect entry with clear intent and minimal complexity. Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/www/lib/redirects.js(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
| source: '/docs/guides/auth/auth-helpers/:path*', | ||
| destination: '/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, let's verify the exact content at lines 1303-1304
echo "=== Content at lines 1303-1304 ==="
sed -n '1303,1304p' apps/www/lib/redirects.js
# Check surrounding context (lines 1300-1310)
echo -e "\n=== Context around lines 1303-1304 ==="
sed -n '1300,1310p' apps/www/lib/redirects.js
# Check the conflicting redirects mentioned
echo -e "\n=== Lines 1326, 1331, 1336 (claimed conflicting redirects) ==="
sed -n '1320,1340p' apps/www/lib/redirects.js
# Search for all auth-helpers redirects in the file
echo -e "\n=== All auth-helpers related redirects ==="
rg -n "auth-helpers" apps/www/lib/redirects.jsRepository: supabase/supabase
Length of output: 2141
🏁 Script executed:
#!/bin/bash
# Check git history for the commit mentioned
echo "=== Checking git log for auth-helpers redirect changes ==="
git log --oneline -20 -- apps/www/lib/redirects.js
# Try to find if there was a recent revert
echo -e "\n=== Searching for revert commits ==="
git log --oneline -50 -- apps/www/lib/redirects.js | grep -i revertRepository: supabase/supabase
Length of output: 207
🏁 Script executed:
#!/bin/bash
# Search for references to auth-helpers paths in documentation and code
echo "=== References to auth-helpers in markdown files ==="
rg "auth-helpers" --type-list | head -5
rg "auth-helpers" -g "*.md" -g "*.mdx" -C 2 | head -100
echo -e "\n=== References to auth-helpers in js/ts files ==="
rg "auth-helpers" -g "*.js" -g "*.ts" -g "*.jsx" -g "*.tsx" -C 1 | head -100Repository: supabase/supabase
Length of output: 18767
🏁 Script executed:
#!/bin/bash
# Search for auth-helpers page content files
echo "=== Searching for auth-helpers content files ==="
find apps/docs/content -name "*auth-helpers*" -o -path "*/auth-helpers*" -type f 2>/dev/null | head -20
# Check if the guides directory has auth-helpers subdirectory
echo -e "\n=== Checking auth-helpers content directory structure ==="
find apps/docs/content/guides/auth -type d | grep -i auth-helpers
# Look for any markdown files in auth-helpers guides
echo -e "\n=== Auth-helpers guide files ==="
find apps/docs/content/guides/auth -name "*.mdx" -o -name "*.md" | grep -i auth-helpersRepository: supabase/supabase
Length of output: 1330
🏁 Script executed:
#!/bin/bash
# Check what's in the auth guides directory
echo "=== Files in auth guides directory ==="
ls -la apps/docs/content/guides/auth/ 2>/dev/null || echo "Directory not found"
# Check for auth-helpers guide file specifically
echo -e "\n=== Searching for auth-helpers.mdx content file ==="
find apps/docs/content -name "auth-helpers.mdx" -o -name "auth-helpers.md"
# Check navigation menu constants to understand the intended state
echo -e "\n=== NavigationMenu constants content (auth-helpers section) ==="
sed -n '1,500p' apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts | grep -A 20 "auth-helpers"Repository: supabase/supabase
Length of output: 3268
🏁 Script executed:
#!/bin/bash
# Check the nav menu structure for auth-helpers
echo "=== Checking NavigationMenu.constants.ts for auth-helpers items ==="
rg -A 30 "auth-helpers" apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts | head -80Repository: supabase/supabase
Length of output: 1953
Address redirect chains created by wildcard auth-helpers pattern.
The wildcard redirect at line 1303 creates 2-hop redirect chains with existing redirects. For example:
/docs/reference/auth-helpers/next-js→/docs/guides/auth/auth-helpers/nextjs(line 1331) →/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers(line 1303)
Auth-helpers pages still exist in the codebase (auth-ui.mdx, nextjs.mdx, sveltekit.mdx, etc.) and are referenced in navigation menus. Permanent 301 redirects that chain degrade SEO performance and user experience.
Either:
- Remove the conflicting redirects (lines 1325–1326, 1330–1331, 1335–1336) if auth-helpers docs are fully deprecated, or
- Make the wildcard pattern more specific to avoid catching intermediate redirects (e.g., redirect only the index, not all paths)
🤖 Prompt for AI Agents
In apps/www/lib/redirects.js around lines 1303–1304 (and conflicting redirects
at 1325–1326, 1330–1331, 1335–1336), the wildcard redirect for
'/docs/guides/auth/auth-helpers/:path*' is causing 2-hop redirect chains with
more specific auth-helpers redirects; either remove the specific redirects
(lines 1325–1326, 1330–1331, 1335–1336) if those pages are fully deprecated, or
replace the wildcard with a single-index redirect (e.g., change the source to
'/docs/guides/auth/auth-helpers' so only the index redirects to
'/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers') to avoid
catching intermediate paths and preserve existing per-page redirects.
This reverts commit c0137e9.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.