Skip to content

Commit

Permalink
fix(urls): add user subdirectory for user profile urls
Browse files Browse the repository at this point in the history
(cherry picked from commit 11d7f46710304671be4a007bcd53af1e503deb60)
  • Loading branch information
Chang Liu committed Jan 22, 2025
1 parent 1b8b3b2 commit 5d19da1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/loading/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function Loading() {
session.user.user_metadata.user_name,
session
)
if (profile && !error) redirect(`/${session.user.user_metadata.user_name}`)
if (profile && !error) redirect(`/user/${session.user.user_metadata.user_name}`)

// GitHub provider_token is null if a user revisits the page after the token has expired
// Sign out user and redirect back to home page. Reference: https://github.com/supabase/gotrue-js/issues/806
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/components/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function LineItem({index, data}: {index: number; data: any}) {
)}
</div>
<Link
href={`/${userName}`}
href={`/user/${userName}`}
className='flex-shrink-0 no-underline hover:underline'>
<p>{userName}</p>
</Link>
Expand Down

0 comments on commit 5d19da1

Please sign in to comment.