From 7c7ebb2ab8183336e5ee7ead4d737d43a0fbf665 Mon Sep 17 00:00:00 2001 From: Opaque02 <66582645+Opaque02@users.noreply.github.com> Date: Wed, 25 Sep 2024 20:02:22 +1000 Subject: [PATCH] Undid some changes and cleaned up some code --- .env.development | 4 ++-- src/ui/menu-ui-handler.ts | 34 +--------------------------------- src/utils.ts | 8 ++++---- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/.env.development b/.env.development index 7ca492fae4c..6c92036270f 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ -VITE_BYPASS_LOGIN=0 +VITE_BYPASS_LOGIN=1 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=http://192.168.1.101:8001 +VITE_SERVER_URL=http://localhost:8001 VITE_DISCORD_CLIENT_ID=1234567890 VITE_GOOGLE_CLIENT_ID=1234567890 VITE_I18N_DEBUG=1 diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 7e9e2de5a19..ab45e8e66c8 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -390,11 +390,9 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { const options: OptionSelectItem[] = []; - //for (let i = 0; i < Object.values(AdminMode).filter((v) => !isNaN(Number(v))).length; i++) { - //fields.forEach((field, f) => { Object.values(AdminMode).filter((v) => !isNaN(Number(v))).forEach((mode) => { options.push({ - label: getAdminModeName(mode), + label: getAdminModeName(mode as AdminMode), handler: () => { ui.playSelect(); ui.setOverlayMode(Mode.ADMIN, { @@ -424,40 +422,10 @@ export default class MenuUiHandler extends MessageUiHandler { options: options, delay: 0 }); - - //ui.playSelect(); - //ui.setOverlayMode(Mode.ADMIN, { - // buttonActions: [ - // () => { - // ui.revertMode(); - // }, - // () => { - // ui.revertMode(); - // } - // ] - //}, AdminMode.LINK); return true; }, keepOpen: true }); - //communityOptions.push({ - // label: "Admin2", - // handler: () => { - // ui.playSelect(); - // ui.setOverlayMode(Mode.ADMIN, { - // buttonActions: [ - // () => { - // ui.revertMode(); - // }, - // () => { - // ui.revertMode(); - // } - // ] - // }, AdminMode.UNLINK); - // return true; - // }, - // keepOpen: true - //}); } communityOptions.push({ label: i18next.t("menuUiHandler:cancel"), diff --git a/src/utils.ts b/src/utils.ts index 2d9c3fca65b..b029067c8d6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -284,16 +284,16 @@ export const isBeta = import.meta.env.MODE === "beta"; // this checks to see if export function setCookie(cName: string, cValue: string): void { const expiration = new Date(); expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/); - document.cookie = `${cName}=${cValue};SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`; + document.cookie = `${cName}=${cValue};Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`; } export function removeCookie(cName: string): void { if (isBeta) { - document.cookie = `${cName}=;SameSite=Strict;Domain=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well + document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well } - document.cookie = `${cName}=;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`; - document.cookie = `${cName}=;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop + document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`; + document.cookie = `${cName}=;Secure;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop } export function getCookie(cName: string): string {