Skip to main content
Glama
AuthenticationBarrierServer.tsx846 B
import { redirect } from 'next/navigation'; import type { FC } from 'react'; import { PagesRoutes } from '@/Routes'; import { type AuthenticationBarrierProps, accessValidation, } from './accessValidation'; type AuthenticationBarrierServerProps = Omit< AuthenticationBarrierProps, 'sessionToken' | 'redirectionFunction' > & { redirectionRoute?: PagesRoutes | string; }; export const AuthenticationBarrierServer: FC< AuthenticationBarrierServerProps > = ({ children, redirectionRoute = PagesRoutes.Home, session, accessRule, isEnabled, }) => { // Do nothing if we have explicitly disabled it if (isEnabled === false) return children; if (typeof session !== 'undefined') { accessValidation( accessRule, session, redirect, redirectionRoute, isEnabled ); } return children; };

Latest Blog Posts

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/aymericzip/intlayer'

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