From af2f7da066c688b8364b6c6ea22d59974213eb95 Mon Sep 17 00:00:00 2001 From: Mathis Date: Fri, 12 Jul 2024 14:08:44 +0200 Subject: [PATCH] feat(auth): add signIn method to the controller. A signIn method was added to the auth.controller file to handle the signin requests. The SignInDto was also imported from the auth.dto to help facilitate this. Furthermore, the console was imported from node to assist with development debugging. --- src/auth/auth.controller.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index b39d810..063b82d 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -1,6 +1,7 @@ import { Body, Controller, HttpCode, HttpStatus, Post } from "@nestjs/common"; -import { SignUpDto } from "src/auth/auth.dto"; +import { SignInDto, SignUpDto } from "src/auth/auth.dto"; import { AuthService } from "src/auth/auth.service"; +import * as console from "node:console"; @Controller("auth") export class AuthController { @@ -15,6 +16,12 @@ export class AuthController { } //POST signin + @HttpCode(HttpStatus.OK) + @Post("signin") + async signIn(@Body() dto: SignInDto) { + console.log(dto); + return this.authService.doLogin(dto); + } //GET me -- Get current user data via jwt //DELETE me //PATCH me