From 7652947ba4862b9e445eab708b2ad416e7af6b1c Mon Sep 17 00:00:00 2001 From: lemuel Date: Sun, 7 Aug 2022 21:03:01 -0500 Subject: [PATCH] cors --- src/app.gateway.ts | 11 ++++++++++- src/institucion/institucion.controller.ts | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/app.gateway.ts b/src/app.gateway.ts index 3cf1249..2f7be35 100644 --- a/src/app.gateway.ts +++ b/src/app.gateway.ts @@ -9,7 +9,16 @@ import { Socket, Server } from 'socket.io'; @WebSocketGateway({ cors: { - origin: '*', + origin: [ + 'http://localhost:3176', + 'http://localhost:3186', + // 'http://132.248.80.196:3155', + // 'http://132.248.80.196:3185', + // 'https://pmodulospcpuma.unam.mx', + // 'http://pmodulospcpuma.unam.mx:3015/', + // 'https://modulospcpuma.unam.mx', + // 'https://modulospcpuma.unam.mx:3015/', + ], }, }) export class AppGateway diff --git a/src/institucion/institucion.controller.ts b/src/institucion/institucion.controller.ts index f966c57..cd35ed5 100644 --- a/src/institucion/institucion.controller.ts +++ b/src/institucion/institucion.controller.ts @@ -50,7 +50,7 @@ export class InstitucionController { get(@Request() req) { const superAdmin: Operador = req.user.operador; - if (!superAdmin || superAdmin.tipoUsuario.id_tipo_usuario != 3) + if (!superAdmin || superAdmin.tipoUsuario.id_tipo_usuario != 2) throw new ForbiddenException( 'No tienes los permisos necesarios para acceder a esta información.', );