feat(web): add same-origin SPA authentication

This commit is contained in:
shaggy (mosaic-dev box)
2026-08-09 20:00:22 -05:00
parent 068d0f9b1c
commit 46d68e1ff4
20 changed files with 987 additions and 143 deletions
+1 -3
View File
@@ -1,12 +1,10 @@
import { io, type Socket } from 'socket.io-client';
const GATEWAY_URL = process.env['NEXT_PUBLIC_GATEWAY_URL'] ?? 'http://localhost:14242';
let socket: Socket | null = null;
export function getSocket(): Socket {
if (!socket) {
socket = io(`${GATEWAY_URL}/chat`, {
socket = io('/chat', {
withCredentials: true,
autoConnect: false,
transports: ['websocket', 'polling'],