Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @httpPost("doAuth")
- @ValidateSize([{login: {min: 6}}, {password: {min: 6}}])
- public async auth(@requestBody("login") login :string, @requestBody("password") pass :string, @response() response :express.Response){
- let user :UserData = await this.authService.auth(login, pass);
- if(!user) return response.sendStatus(403);
- return user;
- }
- export function ValidateSize(param :string) {
- return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
- return {
- value: function (...args: any[]) {
- //Тут мне нужно достать переменные
- //login, pass чтобы проверить их длину
- }
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement