K1 30 Set up routing for Clerk Admin/Player Dashboard#17
Merged
emi-a-dinh merged 2 commits intodevelopfrom Mar 13, 2026
Merged
Conversation
emi-a-dinh
requested changes
Mar 13, 2026
Collaborator
emi-a-dinh
left a comment
There was a problem hiding this comment.
Everything looks good and functions as expected. Please fix the merge conflict and it should be ready to merge into main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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