fix(api): use getTrustedOrigins() for WebSocket CORS #549
@@ -7,6 +7,7 @@ import {
|
|||||||
import { Logger } from "@nestjs/common";
|
import { Logger } from "@nestjs/common";
|
||||||
import { Server, Socket } from "socket.io";
|
import { Server, Socket } from "socket.io";
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
|
import { getTrustedOrigins } from "../auth/auth.config";
|
||||||
import { PrismaService } from "../prisma/prisma.service";
|
import { PrismaService } from "../prisma/prisma.service";
|
||||||
|
|
||||||
interface AuthenticatedSocket extends Socket {
|
interface AuthenticatedSocket extends Socket {
|
||||||
@@ -77,7 +78,7 @@ interface StepOutputData {
|
|||||||
*/
|
*/
|
||||||
@WSGateway({
|
@WSGateway({
|
||||||
cors: {
|
cors: {
|
||||||
origin: process.env.WEB_URL ?? "http://localhost:3000",
|
origin: getTrustedOrigins(),
|
||||||
credentials: true,
|
credentials: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user