import { Controller, Post, Body, HttpCode, HttpStatus } from '@nestjs/common'; import LoginResponseDto from './dto/loginResponse.dto'; import { AuthService } from './auth.service'; import { LoginDto } from './dto/login.dto'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @Post('login') async login(@Body() loginDto: LoginDto): Promise { return this.authService.login(loginDto); } @Post('logout') @HttpCode(HttpStatus.OK) async logout(@Body() body: { refreshToken: string }): Promise { return this.authService.logout(body.refreshToken); } @Post('refresh-token') async refreshToken( @Body() body: { refreshToken: string }, ): Promise { return this.authService.refreshToken(body.refreshToken); } }