Skip to content

feat: implement role-based authentication with Passport JWT#503

Open
Spycall wants to merge 2 commits into
GalactiGuild:mainfrom
Spycall:feature/role-based-auth
Open

feat: implement role-based authentication with Passport JWT#503
Spycall wants to merge 2 commits into
GalactiGuild:mainfrom
Spycall:feature/role-based-auth

Conversation

@Spycall
Copy link
Copy Markdown

@Spycall Spycall commented Apr 29, 2026

  • Add UserRole enum (INVESTOR, CREATOR, ADMIN) to Prisma schema
  • Add role field to User model with default INVESTOR role
  • Install @nestjs/passport, passport, passport-jwt dependencies
  • Create JWT strategy for token validation
  • Create Roles decorator and RolesGuard for role-based access control
  • Create AuthModule with JWT configuration
  • Update admin routes (/admin/*) to require JWT auth + ADMIN role
  • Update institutional routes (/institutional) to require JWT auth + ADMIN role
  • Update user freeze request review endpoint to require JWT auth + ADMIN role
  • Integrate AuthModule into main AppModule

This implements secure, token-based session management that distinguishes between Investor, Creator, and Admin roles, protecting sensitive admin and internal routes.

- Add UserRole enum (INVESTOR, CREATOR, ADMIN) to Prisma schema
- Add role field to User model with default INVESTOR role
- Install @nestjs/passport, passport, passport-jwt dependencies
- Create JWT strategy for token validation
- Create Roles decorator and RolesGuard for role-based access control
- Create AuthModule with JWT configuration
- Update admin routes (/admin/*) to require JWT auth + ADMIN role
- Update institutional routes (/institutional) to require JWT auth + ADMIN role
- Update user freeze request review endpoint to require JWT auth + ADMIN role
- Integrate AuthModule into main AppModule

This implements secure, token-based session management that distinguishes between Investor, Creator, and Admin roles, protecting sensitive admin and internal routes.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

Hey @Spycall! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#357 Implement JWT-based Role Access Control (RBAC) Link to this issue
#356 Create Multi-Tenant Database Architecture for Analytics Link to this issue

ℹ️ Learn more about linking PRs to issues

@Spycall
Copy link
Copy Markdown
Author

Spycall commented Apr 29, 2026

Closes #503

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.

1 participant