update cors
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
Inject,
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
import Clerk from '@clerk/clerk-sdk-node';
|
||||
import Clerk from '@clerk/express';
|
||||
import { GqlExecutionContext } from '@nestjs/graphql';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Module, Global } from '@nestjs/common';
|
||||
import Clerk from '@clerk/clerk-sdk-node';
|
||||
import Clerk from '@clerk/express';
|
||||
import { ClerkService } from './clerk.service';
|
||||
import ClerkController from './clerk.controller';
|
||||
@Global()
|
||||
|
||||
@@ -7,8 +7,7 @@ import {
|
||||
} from '@smatch-corp/nestjs-pothos';
|
||||
import { Builder } from '../Graphql/graphql.builder';
|
||||
import { PrismaService } from '../Prisma/prisma.service';
|
||||
import { clerkClient } from '@clerk/clerk-sdk-node';
|
||||
|
||||
import { clerkClient } from '@clerk/express';
|
||||
@Injectable()
|
||||
export class UserSchema extends PothosSchema {
|
||||
constructor(
|
||||
|
||||
@@ -4,8 +4,10 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
const corsOrigin = (process.env.CORS_ORIGIN ?? '').split(','); // split by comma to array
|
||||
app.enableCors({
|
||||
origin: process.env.CORS_ORIGIN,
|
||||
origin: corsOrigin,
|
||||
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
|
||||
allowedHeaders: ['Content-Type', 'Authorization'],
|
||||
credentials: true,
|
||||
|
||||
Reference in New Issue
Block a user