import { Body, Controller, Post } from '@nestjs/common'; import { AuthService, RegisterInput } from './auth.service'; import { AuthResult } from './auth.types'; import { Public } from '../../common/auth/public.decorator'; @Public() @Controller('auth') export class AuthController { constructor(private readonly auth: AuthService) {} @Post('register') register(@Body() body: RegisterInput): Promise { return this.auth.register(body); } @Post('login') login(@Body() body: { username: string; password: string }): Promise { return this.auth.login(body.username, body.password); } }