Skip to content

Authentication

The admin panel is protected by role-based authentication. Only users with the ADMIN role can access it.

  1. Navigate to the admin panel URL
  2. Enter your admin email and password
  3. The system verifies your credentials AND checks for ADMIN role
  4. If authenticated with correct role, you’re redirected to the dashboard
  • UI placeholders exist for MetaMask/WalletConnect login
  • Same SIWE flow as the main platform
  • Backend integration pending
  • Google/Apple OAuth buttons visible but deferred
  • Will require ADMIN role verification after OAuth

The AdminGuard component protects all admin routes:

  • Valid admin token → access granted
  • Valid non-admin token → “Admin access required” rejection screen
  • No token/expired → redirected to login page
  • JWT tokens are stored in localStorage
  • Proactive token refresh — tokens refresh 30 seconds before expiry
  • 401 retry — failed requests automatically retry with a fresh token
  • Concurrent refresh dedup — multiple simultaneous refresh calls are deduplicated
  • Logout — clears all stored tokens and redirects to login
  • Admin credentials should be strong and unique
  • Sessions auto-expire after token lifetime
  • All API communication uses HTTPS
  • Role verification happens server-side — client-side guards are a UX layer only