From ba06458d4b74324b8c4b3aa12e16dfc747f40142 Mon Sep 17 00:00:00 2001 From: lemuel Date: Fri, 2 Sep 2022 11:10:13 -0500 Subject: [PATCH 1/2] merge --- src/app.gateway.ts | 10 +++++----- src/auth/dto/input/login-admin.dto.ts | 3 +-- src/auth/dto/input/login-operador.dto.ts | 3 +-- src/auth/dto/input/login-usuario.dto.ts | 3 +-- src/auth/dto/jwt-payload-operador.ts | 13 +++++++++++++ src/auth/dto/jwt-payload-usuario.ts | 18 ++++++++++++++++++ 6 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 src/auth/dto/jwt-payload-operador.ts create mode 100644 src/auth/dto/jwt-payload-usuario.ts diff --git a/src/app.gateway.ts b/src/app.gateway.ts index 266fd7d..c22d4f7 100644 --- a/src/app.gateway.ts +++ b/src/app.gateway.ts @@ -10,15 +10,15 @@ import { Socket, Server } from 'socket.io'; @WebSocketGateway({ cors: { origin: [ - // 'http://localhost:3176', - // 'http://localhost:3186', + 'http://localhost:3176', + 'http://localhost:3186', // 'http://132.248.80.196:3155', // 'http://132.248.80.196:3185', // 'https://pmodulospcpuma.unam.mx', // 'https://pmodulospcpuma.unam.mx:3015', - 'https://modulospcpuma.unam.mx', - 'https://modulospcpuma.unam.mx:3015', - 'https://betelgeuse.acatlan.unam.mx:3180', + // 'https://modulospcpuma.unam.mx', + // 'https://modulospcpuma.unam.mx:3015', + // 'https://betelgeuse.acatlan.unam.mx:3180', ], }, }) diff --git a/src/auth/dto/input/login-admin.dto.ts b/src/auth/dto/input/login-admin.dto.ts index 7c04f56..6b274cb 100644 --- a/src/auth/dto/input/login-admin.dto.ts +++ b/src/auth/dto/input/login-admin.dto.ts @@ -1,9 +1,8 @@ -import { IsNotEmpty, IsString, MaxLength } from 'class-validator'; +import { IsNotEmpty, IsString } from 'class-validator'; export class LoginAdminDto { @IsString() @IsNotEmpty() - @MaxLength(40) operador: string; @IsString() diff --git a/src/auth/dto/input/login-operador.dto.ts b/src/auth/dto/input/login-operador.dto.ts index 37517f0..f54c039 100644 --- a/src/auth/dto/input/login-operador.dto.ts +++ b/src/auth/dto/input/login-operador.dto.ts @@ -1,4 +1,4 @@ -import { IsInt, IsNotEmpty, IsString, MaxLength } from 'class-validator'; +import { IsInt, IsNotEmpty, IsString } from 'class-validator'; export class LoginOperadorDto { @IsInt() @@ -6,7 +6,6 @@ export class LoginOperadorDto { @IsString() @IsNotEmpty() - @MaxLength(40) operador: string; @IsString() diff --git a/src/auth/dto/input/login-usuario.dto.ts b/src/auth/dto/input/login-usuario.dto.ts index a7f2047..ef29bc0 100644 --- a/src/auth/dto/input/login-usuario.dto.ts +++ b/src/auth/dto/input/login-usuario.dto.ts @@ -1,4 +1,4 @@ -import { IsNotEmpty, IsString, MaxLength } from 'class-validator'; +import { IsNotEmpty, IsString } from 'class-validator'; export class LoginUsuarioDto { @IsString() @@ -6,6 +6,5 @@ export class LoginUsuarioDto { @IsString() @IsNotEmpty() - @MaxLength(10) usuario: string; } diff --git a/src/auth/dto/jwt-payload-operador.ts b/src/auth/dto/jwt-payload-operador.ts new file mode 100644 index 0000000..24875dc --- /dev/null +++ b/src/auth/dto/jwt-payload-operador.ts @@ -0,0 +1,13 @@ +export class JwtPayload { + id_operador: number; + + nombre: string; + + operador: string; + + institucion: { id_institucion: number }; + + tipoUsuario: { id_tipo_usuario: number }; + + id_modulo?: number; +} diff --git a/src/auth/dto/jwt-payload-usuario.ts b/src/auth/dto/jwt-payload-usuario.ts new file mode 100644 index 0000000..f52f224 --- /dev/null +++ b/src/auth/dto/jwt-payload-usuario.ts @@ -0,0 +1,18 @@ +export class JwtPayload { + id_usuario: number; + + nombre: string; + + usuario: string; + + tipoUsuario: { id_tipo_usuario: number }; + + instituciones: { + id_institucion_usuario: number; + institucionCarrera: { + id_institucion_carrera: number; + institucion: { id_institucion: number }; + carrera: { id_carrera: number }; + }; + }[]; +} From 7de372a4bce81f9372d04e5c9d904d001b5f398c Mon Sep 17 00:00:00 2001 From: lemuel Date: Mon, 5 Sep 2022 11:50:22 -0500 Subject: [PATCH 2/2] listo pruebas --- src/app.gateway.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.gateway.ts b/src/app.gateway.ts index c22d4f7..57af0e0 100644 --- a/src/app.gateway.ts +++ b/src/app.gateway.ts @@ -10,12 +10,12 @@ import { Socket, Server } from 'socket.io'; @WebSocketGateway({ cors: { origin: [ - 'http://localhost:3176', - 'http://localhost:3186', + // 'http://localhost:3176', + // 'http://localhost:3186', // 'http://132.248.80.196:3155', // 'http://132.248.80.196:3185', - // 'https://pmodulospcpuma.unam.mx', - // 'https://pmodulospcpuma.unam.mx:3015', + 'https://pmodulospcpuma.unam.mx', + 'https://pmodulospcpuma.unam.mx:3015', // 'https://modulospcpuma.unam.mx', // 'https://modulospcpuma.unam.mx:3015', // 'https://betelgeuse.acatlan.unam.mx:3180',