diff --git a/src/UI/UIWindowLogin.js b/src/UI/UIWindowLogin.js index 69386350..6cbb9733 100644 --- a/src/UI/UIWindowLogin.js +++ b/src/UI/UIWindowLogin.js @@ -162,7 +162,30 @@ async function UIWindowLogin(options){ $(el_window).close(); }, error: function (err){ - $(el_window).find('.login-error-msg').html(err.responseText); + const $errorMessage = $(el_window).find('.login-error-msg'); + if (err.status === 404) { + // Don't include the whole 404 page + $errorMessage.html(`Error 404: "${gui_origin}/login" not found`); + } else if (err.responseText) { + $errorMessage.html(err.responseText); + } else { + // No message was returned. *Probably* this means we couldn't reach the server. + // If this is a self-hosted instance, it's probably a configuration issue. + if (app_domain !== 'puter.com') { + $errorMessage.html(`
+

Error reaching "${gui_origin}/login". This is likely to be a configuration issue.

+

Make sure of the following:

+ +
`); + } else { + $errorMessage.html(`Failed to log in: Error ${err.status}`); + } + } $(el_window).find('.login-error-msg').fadeIn(); } });