Hopefully fixed domain
This commit is contained in:
+3
-3
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user