Skip to content

Commit 0347a38

Browse files
committed
fix: handle all temp user errors by reloading
1 parent c8d52b3 commit 0347a38

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/gui/src/initgui.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,12 @@ window.initgui = async function(options){
845845
window.update_auth_data(data.token, data.user);
846846
document.dispatchEvent(new Event("login", { bubbles: true}));
847847
},
848-
error: function (err){
849-
UIAlert({
850-
message: html_encode(err.responseText),
851-
});
848+
error: async (err) => {
849+
// The solution to any error that might happen here is to reload the page.
850+
// We only try to sign into a temporary user on the first visit, so if it
851+
// didn't work reloading the page will produce the login screen.
852+
console.log('could not create temporary user', err);
853+
window.location.reload();
852854
}
853855
});
854856
}

0 commit comments

Comments
 (0)