Skip to content

K1 30 Set up routing for Clerk Admin/Player Dashboard#17

Merged
emi-a-dinh merged 2 commits intodevelopfrom
K1-30-Set-up-routing-for-Clerk-Admin/Player-Dashboard
Mar 13, 2026
Merged

K1 30 Set up routing for Clerk Admin/Player Dashboard#17
emi-a-dinh merged 2 commits intodevelopfrom
K1-30-Set-up-routing-for-Clerk-Admin/Player-Dashboard

Conversation

@OverseerUniverse
Copy link
Copy Markdown
Collaborator

Developer: Nathaniel Victorino

Closes #K1-30

Pull Request Summary

I added middleware to identify admin and public routes. Roles are now handled and authenticated by clerks session tokens: https://clerk.com/docs/guides/sessions/customize-session-tokens

Instructions to get admin will be in the confluence "how to" section.
Getting admin relies on a patch endpoint. Clerk will mirror whatever is stored in mongodb.
This endpoints protection is currently commented out, so anyone can change roles.
Perhaps to make it safer I can add checks for whether the mongodb role string is a valid option. (admin/player)

Dashboard is now a redirect to the users proper dashboard according to role within clerk.
Add these to env:
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Copy link
Copy Markdown
Collaborator

@emi-a-dinh emi-a-dinh left a comment

Choose a reason for hiding this comment

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

Everything looks good and functions as expected. Please fix the merge conflict and it should be ready to merge into main.

Copy link
Copy Markdown
Collaborator

@emi-a-dinh emi-a-dinh left a comment

Choose a reason for hiding this comment

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

Looks good!

@emi-a-dinh emi-a-dinh merged commit 0893589 into develop Mar 13, 2026
4 checks passed
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