Advertisement
Guest User

Untitled

a guest
Sep 9th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. @httpPost("doAuth")
  2. @ValidateSize([{login: {min: 6}}, {password: {min: 6}}])
  3. public async auth(@requestBody("login") login :string, @requestBody("password") pass :string, @response() response :express.Response){
  4. let user :UserData = await this.authService.auth(login, pass);
  5. if(!user) return response.sendStatus(403);
  6. return user;
  7. }
  8.  
  9. export function ValidateSize(param :string) {
  10. return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
  11. return {
  12. value: function (...args: any[]) {
  13. //Тут мне нужно достать переменные
  14. //login, pass чтобы проверить их длину
  15.  
  16. }
  17. };
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement