From 768600e48e6f869c0a62e7c3281c2f3d6d40840f Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 15 Sep 2023 16:13:09 -0600 Subject: [PATCH] Logout in devel mode generates a new TeamID --- theme/index.mjs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/theme/index.mjs b/theme/index.mjs index e9de612..231c845 100644 --- a/theme/index.mjs +++ b/theme/index.mjs @@ -10,12 +10,6 @@ class App { this.server = new moth.Server(basePath) - let uuid = Math.floor(Math.random() * 1000000).toString(16) - this.fakeRegistration = { - TeamID: uuid, - TeamName: `Team ${uuid}`, - } - for (let form of document.querySelectorAll("form.login")) { form.addEventListener("submit", event => this.handleLoginSubmit(event)) } @@ -103,9 +97,10 @@ class App { } if (this.state.DevelopmentMode() && !this.server.LoggedIn()) { + let teamID = Math.floor(Math.random() * 1000000).toString(16) common.Toast("Automatically logging in to devel server") - console.info("Logging in with generated Team ID and Team Name", this.fakeRegistration) - return this.Login(this.fakeRegistration.TeamID, this.fakeRegistration.TeamName) + console.info(`Logging in with generated Team ID: ${teamID}`) + return this.Login(teamID, `Team ${teamID}`) } }