ADD: added new auth middleware and changed the roles value ind the jwt token to a array
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user