Skip to content

feat: redirect to profile page on login - #131

Open
robsimmons wants to merge 2 commits into
mainfrom
profile-redirect
Open

robsimmons wants to merge 2 commits into
mainfrom
profile-redirect

Conversation

@robsimmons

@robsimmons robsimmons commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Creates a /profile URL that redirects to the signed-in users' profile, and redirects most logins there so that people initially go to their login page instead of the sparse root URL.

Comment thread src/app/profile/page.tsx

export default async function UserProfileForward() {
const auth = await requireAuth()
if (auth.user.name === 'profile') throw new Error('Unsupported username')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this rather be prevented during sign-up, in the better-auth hook for validating a new user profile? On that note we should also forbid other route names like 'setup'.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

And "admin", and if we allow names from anywhere besides github we're going to need a name-collision-avoiding mechanism. Filed #132

@robsimmons
robsimmons force-pushed the profile-redirect branch 2 times, most recently from 0a43671 to 5a0aa5f Compare September 9, 2026 17:59
@robsimmons
robsimmons force-pushed the oauth-refresh branch 2 times, most recently from 69e0756 to c24b4fd Compare September 9, 2026 18:01
@robsimmons
robsimmons changed the base branch from oauth-refresh to main September 9, 2026 18:26
@robsimmons
robsimmons requested a review from Vtec234 September 9, 2026 19:47
@robsimmons

Copy link
Copy Markdown
Collaborator Author

@Vtec234 curious on your feeling as to whether we should solve #132 before trying to merge this, I could go either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants