JWT Auth + RBAC Demo

Test the authentication and role-based access control system

Not logged in
Please login or register to test the system
๐Ÿ” Authentication Features
Secure JWT-based authentication system
  • โœ… User registration and login
  • โœ… HttpOnly cookies for security
  • โœ… Password hashing with bcrypt
  • โœ… JWT token validation
  • โœ… Automatic logout and session management
๐Ÿ‘ฅ Role-Based Access Control
Three-tier permission system
USER

Basic dashboard access

MANAGER

Manager dashboard + all USER permissions

ADMIN

Admin dashboard + all permissions

๐Ÿงช Test the System
Try registering users with different roles and testing access

1. Register Test Users

Create accounts with different roles to test permissions:

Regular User

Register normally (default role: USER)

Manager

Backend: Create user with role: "MANAGER"

Admin

Backend: Create user with role: "ADMIN"

2. Test Role Access

Login first to test role-based access

๐Ÿ”ง Backend API Endpoints
Available authentication endpoints
Authentication
  • POST /auth/register - Create new user
  • POST /auth/login - Login user
  • POST /auth/logout - Logout user
  • GET /auth/me - Get current user
GraphQL
  • /graphql - GraphQL endpoint
  • Context includes authenticated user
  • Role-based resolver protection
  • JWT verification middleware