anhledger12 commited on
Commit
a490f00
2 Parent(s): d279573 fa2fb3b

Merge pull request #10 from PBL6-team-CATS/feature/login

Browse files
backend/src/modules/authentication/authentication.controller.ts CHANGED
@@ -7,8 +7,10 @@ import {
7
  Post,
8
  Request,
9
  } from '@nestjs/common';
10
- import { AuthenticationService } from './authentication.service.js';
11
- import { Public } from './authentication.decorator.js';
 
 
12
 
13
  @Controller('authentication')
14
  export class AuthenticationController {
@@ -17,11 +19,8 @@ export class AuthenticationController {
17
  @Public()
18
  @HttpCode(HttpStatus.OK)
19
  @Post('login')
20
- signIn(@Body() signInDto: Record<string, any>) {
21
- return this.AuthenticationService.signIn(
22
- signInDto.username,
23
- signInDto.password,
24
- );
25
  }
26
 
27
  // @UseGuards(AuthenticationGuard)
 
7
  Post,
8
  Request,
9
  } from '@nestjs/common';
10
+ import { AuthenticationGuard } from './authentication.guard';
11
+ import { AuthenticationService } from './authentication.service';
12
+ import { Public } from './authentication.decorator';
13
+ import { SignInDto } from './dto/sign-in.dto';
14
 
15
  @Controller('authentication')
16
  export class AuthenticationController {
 
19
  @Public()
20
  @HttpCode(HttpStatus.OK)
21
  @Post('login')
22
+ signIn(@Body() signInDto: SignInDto) {
23
+ return this.AuthenticationService.signIn(signInDto.username, signInDto.password);
 
 
 
24
  }
25
 
26
  // @UseGuards(AuthenticationGuard)