fix: handle all temp user errors by reloading

This commit is contained in:
KernelDeimos
2025-04-09 13:27:30 -04:00
parent c8d52b3203
commit 0347a38136
+6 -4
View File
@@ -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();
}
});
}