mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-03 11:19:08 +00:00
FIX: Invalid auth credentials return
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
|
||||
import { AuthClientService } from 'src/clients/auth/client.service';
|
||||
|
||||
@@ -18,7 +24,9 @@ export class AuthController {
|
||||
const tokens = await this.authClient
|
||||
.signIn({ username, password })
|
||||
.then((result) => result)
|
||||
.catch((err) => console.log(err));
|
||||
.catch((err) => {
|
||||
throw new HttpException(err.message, HttpStatus.UNAUTHORIZED);
|
||||
});
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user