diff --git a/apps/api/src/auth/auth.controller.ts b/apps/api/src/auth/auth.controller.ts index 43ff1f8..e054837 100644 --- a/apps/api/src/auth/auth.controller.ts +++ b/apps/api/src/auth/auth.controller.ts @@ -1,10 +1,10 @@ /* eslint-disable class-methods-use-this */ /* eslint-disable import/no-extraneous-dependencies */ -import { Controller, Get, HttpException, HttpStatus, Post, Req, Res } from '@nestjs/common'; +import { Body, Controller, Get, HttpException, HttpStatus, Post, Req, Res } from '@nestjs/common'; import { FastifyReply, FastifyRequest } from 'fastify'; import { AuthService } from './auth.service'; import { COOKIE_TOKEN_NAME } from './lib/constants'; -import type { Credentials } from './types/request'; +import { Credentials } from './types/request'; @Controller() export class AuthController { @@ -27,8 +27,8 @@ export class AuthController { } @Post('/signin') - async login(@Req() req: FastifyRequest, @Res() reply: FastifyReply) { - const { login, password } = req.body as Credentials; + async login(@Body() credentials: Credentials, @Res() reply: FastifyReply) { + const { login, password } = credentials; try { const token = await this.authService.login(login, password);