fix: serve board directly at /:slug without redirect

Changed catch-all route to render Board component directly instead
of redirecting to /board/:slug/. Now canvas.jeffemmett.com/ccc shows
the board without changing the URL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-01-02 20:00:56 +01:00
parent 80f457f615
commit b8f179c9c1
1 changed files with 12 additions and 12 deletions

View File

@ -119,14 +119,6 @@ const RedirectBoardSlug = () => {
return <Navigate to={`/board/${slug}/`} replace />; return <Navigate to={`/board/${slug}/`} replace />;
}; };
/**
* Component to redirect direct slug URLs to board URLs
* Handles canvas.jeffemmett.com/ccc /board/ccc/
*/
const RedirectDirectSlug = () => {
const { slug } = useParams<{ slug: string }>();
return <Navigate to={`/board/${slug}/`} replace />;
};
/** /**
* Main App with context providers * Main App with context providers
@ -223,11 +215,19 @@ const AppWithProviders = () => {
<Route path="/google" element={<GoogleDataTest />} /> <Route path="/google" element={<GoogleDataTest />} />
<Route path="/oauth/google/callback" element={<GoogleDataTest />} /> <Route path="/oauth/google/callback" element={<GoogleDataTest />} />
{/* Catch-all: Direct slug URLs redirect to board URLs */} {/* Catch-all: Direct slug URLs serve board directly */}
{/* e.g., canvas.jeffemmett.com/ccc → /board/ccc/ */} {/* e.g., canvas.jeffemmett.com/ccc → shows board "ccc" */}
{/* Must be LAST to not interfere with other routes */} {/* Must be LAST to not interfere with other routes */}
<Route path="/:slug" element={<RedirectDirectSlug />} /> <Route path="/:slug" element={
<Route path="/:slug/" element={<RedirectDirectSlug />} /> <OptionalAuthRoute>
<Board />
</OptionalAuthRoute>
} />
<Route path="/:slug/" element={
<OptionalAuthRoute>
<Board />
</OptionalAuthRoute>
} />
</Routes> </Routes>
</Suspense> </Suspense>
</BrowserRouter> </BrowserRouter>