From 0347a38136861288cdac8ed35d90c2a428ba2d98 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Wed, 9 Apr 2025 13:27:30 -0400 Subject: [PATCH] fix: handle all temp user errors by reloading --- src/gui/src/initgui.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index 82d8b27ac..77d800b9d 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -845,10 +845,12 @@ window.initgui = async function(options){ window.update_auth_data(data.token, data.user); document.dispatchEvent(new Event("login", { bubbles: true})); }, - error: function (err){ - UIAlert({ - message: html_encode(err.responseText), - }); + error: async (err) => { + // The solution to any error that might happen here is to reload the page. + // We only try to sign into a temporary user on the first visit, so if it + // didn't work reloading the page will produce the login screen. + console.log('could not create temporary user', err); + window.location.reload(); } }); }