mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-26 11:22:19 +00:00
fix: handle all temp user errors by reloading
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user