mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-15 05:59:09 +00:00
Better error handling and documentation on refresh token
This commit is contained in:
@@ -13,7 +13,12 @@ import {
|
||||
Req,
|
||||
Param,
|
||||
} from '@nestjs/common';
|
||||
import { ApiHeaders, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiHeaders,
|
||||
ApiOkResponse,
|
||||
ApiSecurity,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
import {
|
||||
AuthChangePasswordRequest,
|
||||
AuthResetPasswordRequest,
|
||||
@@ -35,6 +40,7 @@ import { GrpcToHttpExceptionFilter } from '../../error/grpc-to-http-exception.fi
|
||||
import { RequestUser, User } from 'src/decorators/user.decorator';
|
||||
import {
|
||||
AuthRefreshAccessTokenReq,
|
||||
AuthRefreshAccessTokenRes,
|
||||
AuthSignInReq,
|
||||
AuthSignInRes,
|
||||
} from './dtos/login';
|
||||
@@ -101,6 +107,7 @@ export class AuthController {
|
||||
|
||||
@Post('refresh-access-token')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOkResponse({ type: AuthRefreshAccessTokenRes })
|
||||
async refreshAccessToken(
|
||||
@Body() body: AuthRefreshAccessTokenReq,
|
||||
@Language() language: LanguageEnum,
|
||||
|
||||
@@ -109,3 +109,9 @@ export class AuthRefreshAccessTokenReq {
|
||||
@ApiProperty()
|
||||
customerName: string;
|
||||
}
|
||||
export class AuthRefreshAccessTokenRes {
|
||||
@ApiProperty()
|
||||
permissions: string[];
|
||||
@ApiProperty()
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export class PermissionsService
|
||||
(process.env.LOCAL_ENV === 'true' || process.env.ENV === 'local')
|
||||
) {
|
||||
return this.logger.info(
|
||||
"couldn't connect to DUC. suppresing in local env",
|
||||
"couldn't connect to DUC. suppressing in local env",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user