diff --git a/app.vue b/app.vue
index 4a8806a..805d415 100644
--- a/app.vue
+++ b/app.vue
@@ -1,9 +1,10 @@
diff --git a/netcode/index.ts b/netcode/index.ts
index 81f7dfc..595bfbd 100644
--- a/netcode/index.ts
+++ b/netcode/index.ts
@@ -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(