fix(api): use TRUSTED_ORIGINS for socket.io gateway CORS (#628)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #628.
This commit is contained in:
@@ -66,7 +66,9 @@ interface StartTranscriptionPayload {
|
|||||||
@WSGateway({
|
@WSGateway({
|
||||||
namespace: "/speech",
|
namespace: "/speech",
|
||||||
cors: {
|
cors: {
|
||||||
origin: process.env.WEB_URL ?? "http://localhost:3000",
|
origin: (process.env.TRUSTED_ORIGINS ?? process.env.WEB_URL ?? "http://localhost:3000")
|
||||||
|
.split(",")
|
||||||
|
.map((s) => s.trim()),
|
||||||
credentials: true,
|
credentials: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ interface AuthenticatedSocket extends Socket {
|
|||||||
@WSGateway({
|
@WSGateway({
|
||||||
namespace: "/terminal",
|
namespace: "/terminal",
|
||||||
cors: {
|
cors: {
|
||||||
origin: process.env.WEB_URL ?? "http://localhost:3000",
|
origin: (process.env.TRUSTED_ORIGINS ?? process.env.WEB_URL ?? "http://localhost:3000")
|
||||||
|
.split(",")
|
||||||
|
.map((s) => s.trim()),
|
||||||
credentials: true,
|
credentials: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -46,3 +46,21 @@ export async function updateTask(
|
|||||||
const res = await apiPatch<ApiResponse<Task>>(`/api/tasks/${id}`, data, workspaceId);
|
const res = await apiPatch<ApiResponse<Task>>(`/api/tasks/${id}`, data, workspaceId);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CreateTaskInput {
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
status?: TaskStatus;
|
||||||
|
priority?: TaskPriority;
|
||||||
|
dueDate?: string;
|
||||||
|
projectId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new task
|
||||||
|
*/
|
||||||
|
export async function createTask(data: CreateTaskInput, workspaceId?: string): Promise<Task> {
|
||||||
|
const { apiPost } = await import("./client");
|
||||||
|
const res = await apiPost<ApiResponse<Task>>("/api/tasks", data, workspaceId);
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user