This commit is contained in:
+14
-1
@@ -105,6 +105,7 @@ export const setup_websocket = () =>
|
||||
return resolve();
|
||||
}
|
||||
const config = useRuntimeConfig();
|
||||
const heron_session = useCookie('heron_session')
|
||||
socket = new WebSocket(config.public.websocketEndpoint);
|
||||
|
||||
socket.onopen = function (e) {
|
||||
@@ -151,14 +152,26 @@ export const setup_websocket = () =>
|
||||
goStore.set_self(data.data);
|
||||
} else if (data.data_type == "current_game"){
|
||||
goStore.set_current_game(data.data)
|
||||
} else if (data.data_type == "session_cookie"){
|
||||
heron_session.value = data.data
|
||||
}
|
||||
|
||||
} else {
|
||||
// console.log(data.type, data.data_type, data.data);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export async function heron_cookie_login(cookie:string){
|
||||
await setup_websocket();
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
type: "cookie_login",
|
||||
data_type: "cookie",
|
||||
data: cookie,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
export async function oauth2_register_discord(code: string) {
|
||||
await setup_websocket();
|
||||
socket.send(
|
||||
|
||||
Reference in New Issue
Block a user