import { Controller, Get, Post, Body } from '@nestjs/common'; import { AuthService } from './AuthService'; import { LoginParams, SignupParams, AuthSessionDTO } from './dtos/AuthDto'; import type { CommandResultDTO } from './presenters/CommandResultPresenter'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @Post('signup') async signup(@Body() params: SignupParams): Promise { return this.authService.signupWithEmail(params); } @Post('login') async login(@Body() params: LoginParams): Promise { return this.authService.loginWithEmail(params); } @Get('session') async getSession(): Promise { return this.authService.getCurrentSession(); } @Post('logout') async logout(): Promise { return this.authService.logout(); } }