MPVN_CMP/backend/src/modules/auth/auth.controller.ts

20 lines
426 B
TypeScript

import { Body, Controller, Post } from '@nestjs/common'
import { AuthService } from './auth.service'
class LoginDto {
email!: string
password!: string
tenantId?: string
}
@Controller('auth')
export class AuthController {
constructor(private readonly authService: AuthService) {}
@Post('login')
async login(@Body() dto: LoginDto) {
return this.authService.login(dto.email, dto.password, dto.tenantId)
}
}