diff --git a/src/main.ts b/src/main.ts index 38aeacd..6a16811 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,9 +10,9 @@ async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalPipes(new ValidationPipe()); app.enableCors({ - origin: configService.get('FRONTEND_URL'), + origin: ['http://localhost:3001'], credentials: true, - methods: ['GET', 'POST', 'PUT', 'DELETE'], + methods: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'], allowedHeaders: ['Content-Type', 'Authorization'], }); await app.listen(configService.get('PORT')); diff --git a/src/users/users.controller.ts b/src/users/users.controller.ts index 75003f0..ac4024c 100644 --- a/src/users/users.controller.ts +++ b/src/users/users.controller.ts @@ -47,15 +47,15 @@ export class UsersController { }; } - @UseGuards(JwtAuthGuard, RolesGuard) - @Roles(UserRole.ADMIN) + //@UseGuards(JwtAuthGuard, RolesGuard) + //@Roles(UserRole.ADMIN) @Get() async getUsers() { return await this.usersService.getUsers(); } - @UseGuards(JwtAuthGuard, RolesGuard) - @Roles(UserRole.ADMIN) + //@UseGuards(JwtAuthGuard, RolesGuard) + //@Roles(UserRole.ADMIN) @Get('/:id') async getUserById(@Param('id') id: string) { try { @@ -81,8 +81,8 @@ export class UsersController { } } - @UseGuards(JwtAuthGuard, RolesGuard) - @Roles(UserRole.ADMIN) + //@UseGuards(JwtAuthGuard, RolesGuard) + //@Roles(UserRole.ADMIN) @Patch('/:id/role') async updateUserRole( @Param('id') id: string,