Skip to main content
Glama

MCP FOR ITSM

PrivateRoute.js759 B
import React from 'react'; import { Navigate } from 'react-router-dom'; import { authService } from '../services/api'; // Component to protect routes that require authentication const PrivateRoute = ({ children, requiredRole }) => { const isAuthenticated = authService.isAuthenticated(); const currentUser = authService.getCurrentUser(); // If user is not authenticated, redirect to login if (!isAuthenticated) { return <Navigate to="/login" />; } // If a specific role is required and user doesn't have it, redirect to dashboard if (requiredRole && currentUser.role !== requiredRole) { return <Navigate to="/" />; } // User is authenticated and has required role if any return children; }; export default PrivateRoute;

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/madosh/MCP-ITSM'

If you have feedback or need assistance with the MCP directory API, please join our Discord server