mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-18 02:19:09 +00:00
REFACTOR: Project Pattern and AuthClient (DUC)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
|
||||
import { AuthClientService } from 'src/clients/auth/client.service';
|
||||
|
||||
interface ISignIn {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(private authClient: AuthClientService) {}
|
||||
|
||||
@Post()
|
||||
async signIn(@Body() { username, password }: ISignIn) {
|
||||
console.log(`/auth`, 'SignIn');
|
||||
|
||||
const tokens = await this.authClient
|
||||
.signIn({ username, password })
|
||||
.then((result) => result)
|
||||
.catch((err) => console.log(err));
|
||||
|
||||
return tokens;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user