From 455b489d719ea5e285e9681c3809ce812ac50a60 Mon Sep 17 00:00:00 2001 From: Greg Akins Date: Thu, 11 Apr 2024 16:04:44 -0400 Subject: [PATCH] MAT-6729: Modifying CORS check to it's specific to our servers, GET & PUT --- src/auth/auth.guard.ts | 1 - src/main.ts | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/auth/auth.guard.ts b/src/auth/auth.guard.ts index cbe5558..d11cdaf 100644 --- a/src/auth/auth.guard.ts +++ b/src/auth/auth.guard.ts @@ -26,7 +26,6 @@ export class AuthGuard implements CanActivate { throw new UnauthorizedException('Token not present'); } try { - console.log('Token', token); const oktaToken = await oktaJwtVerifier.verifyAccessToken( token, 'api://default', diff --git a/src/main.ts b/src/main.ts index 43f0d0f..bdcbc30 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,17 @@ import { NestFactory } from '@nestjs/core'; import { ExportModule } from './export.module'; export async function bootstrap() { - const app = await NestFactory.create(ExportModule, { cors: true }); + const app = await NestFactory.create(ExportModule); + app.enableCors({ + origin: [ + 'http://localhost:9000', + 'https://dev-madie.hcqis.org', + 'https://test-madie.hcqis.org', + 'https://impl-madie.hcqis.org', + 'https://madie.cms.gov', + ], + methods: ['GET', 'PUT'], + }); await app.listen(3000); } bootstrap();