authorization presenter

This commit is contained in:
Gsk54
2023-01-18 11:30:37 +01:00
parent 1d2e7da673
commit 7dc6e7795f
12 changed files with 93 additions and 26 deletions

View File

@@ -0,0 +1,14 @@
import { Injectable, ValidationPipe } from '@nestjs/common';
import { RpcException } from '@nestjs/microservices';
@Injectable()
export class RpcValidationPipe extends ValidationPipe {
createExceptionFactory() {
return (validationErrors = []) => {
return new RpcException({
code: 3,
message: this.flattenValidationErrors(validationErrors),
});
};
}
}