Skip to content

fix: redirect to role-appropriate dashboard after GitHub OAuth (#77) - #172

Open
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/77-oauth-redirect-roles
Open

fix: redirect to role-appropriate dashboard after GitHub OAuth (#77)#172
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/77-oauth-redirect-roles

Conversation

@rafaio1

@rafaio1 rafaio1 commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #77.

  • Replace the hardcoded /dashboard/contributor redirect in CallbackClient with role-aware logic that reads user.roles after login(token) resolves.
  • Precedence: maintainer > sponsor > contributor. A user with roles: ["maintainer"] lands on /dashboard/maintainer; ["sponsor"] lands on /dashboard/sponsor; multiple roles follow the same precedence.
  • Falls back to /dashboard/contributor when user is null (refresh failed internally) or roles is empty/absent — explicit, intentional default rather than an unconditional assumption.
  • Scope note: This fix is scoped to the post-OAuth redirect target only. user.roles remains unused elsewhere in the app (confirmed via grep); Navbar/DashboardShell role-based rendering is covered separately by Fix Navbar loading-state flashes and multi-role rendering logic #48.
  • TypeScript compiles cleanly with npx tsc --noEmit.

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

CallbackClient always redirects to /dashboard/contributor after GitHub OAuth; AuthUser.roles is fetched but never read anywhere

1 participant