ADD: added new auth middleware and changed the roles value ind the jwt token to a array

This commit is contained in:
hwinkel
2025-11-23 22:55:04 +01:00
parent 139a99d96e
commit 3a6c3a86e3
9 changed files with 84 additions and 30 deletions

View File

@@ -19,7 +19,7 @@ const TeamManagement = () => {
const token = localStorage.getItem('token');
const user = token ? getUserFromToken(token) : null;
const isAdmin = user?.role === 'admin';
const isAdmin = user?.role?.includes('admin');
const fetchTeams = async () => {
const res = await fetch('/api/teams', {