Hopefully fixed domain

This commit is contained in:
2025-10-13 22:48:15 +02:00
parent 3e29c53127
commit e498372072
+3 -3
View File
@@ -19,16 +19,16 @@ export async function makeAddress(ip: string, defaultPort = 7080) {
} }
export default async function auth( export default async function auth(
address: string, ip: string,
wsRef: RefObject<WebSocket | null>, wsRef: RefObject<WebSocket | null>,
setServer: Dispatch<SetStateAction<Server | undefined>>, setServer: Dispatch<SetStateAction<Server | undefined>>,
setMessages: Dispatch<SetStateAction<Message[]>>, setMessages: Dispatch<SetStateAction<Message[]>>,
onNewMessage?: (m: Message) => void onNewMessage?: (m: Message) => void
) { ) {
const ip = await makeAddress(address);
console.log("Authenticating with server at:", ip); console.log("Authenticating with server at:", ip);
const server_auth = ( const server_auth = (
(await axios.post("/api/auth", { server_ip: ip })).data as any (await axios.post("/api/auth", { server_ip: await makeAddress(ip) }))
.data as any
).token; ).token;
// Open the WebSocket connection // Open the WebSocket connection