Skip to main content
Glama
auth.controller.ts1.15 kB
import { Controller, Post, Body, HttpCode, HttpStatus } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; import { AuthService } from './auth.service'; import { RegisterDto } from './dto/register.dto'; import { LoginDto } from './dto/login.dto'; import { AuthResponseDto } from './dto/auth-response.dto'; @ApiTags('Authentication') @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @Post('register') @HttpCode(HttpStatus.CREATED) @ApiOperation({ summary: 'Register a new user' }) @ApiResponse({ status: 201, description: 'User registered successfully', type: AuthResponseDto, }) async register(@Body() registerDto: RegisterDto): Promise<AuthResponseDto> { return this.authService.register(registerDto); } @Post('login') @HttpCode(HttpStatus.OK) @ApiOperation({ summary: 'Login user' }) @ApiResponse({ status: 200, description: 'Login successful', type: AuthResponseDto, }) async login(@Body() loginDto: LoginDto): Promise<AuthResponseDto> { return this.authService.login(loginDto); } }

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