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.
This commit is contained in:
parent
a157553b78
commit
af2f7da066
@ -1,6 +1,7 @@
|
|||||||
import { Body, Controller, HttpCode, HttpStatus, Post } from "@nestjs/common";
|
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 { AuthService } from "src/auth/auth.service";
|
||||||
|
import * as console from "node:console";
|
||||||
|
|
||||||
@Controller("auth")
|
@Controller("auth")
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
@ -15,6 +16,12 @@ export class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//POST signin
|
//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
|
//GET me -- Get current user data via jwt
|
||||||
//DELETE me
|
//DELETE me
|
||||||
//PATCH me
|
//PATCH me
|
||||||
|
Loading…
x
Reference in New Issue
Block a user