Skip to main content
Glama
jwt.strategy.ts630 B
import { Injectable } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { ExtractJwt, Strategy } from 'passport-jwt'; import { getJwtConfig } from '../../../config/jwt.config'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy) { constructor() { const config = getJwtConfig(); super({ jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), ignoreExpiration: false, secretOrKey: config.secret, }); } async validate(payload: any) { return { id: payload.sub, email: payload.email, tier: payload.tier, }; } }

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/aiatamai/atamai-mcp'

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