Show fullscreen overlay when signup is blocked (#2947)

This commit is contained in:
Nariman Jelveh
2026-05-07 11:37:23 -07:00
committed by GitHub
parent 6c19dfbafd
commit ff10e47d67
3 changed files with 86 additions and 0 deletions
+16
View File
@@ -386,6 +386,22 @@ function UIWindowSignup (options) {
// Try to parse error as JSON
const errorJson = JSON.parse(errorText);
// Handle signup blocked with full-screen overlay
if ( errorJson?.code === 'signup_blocked' ) {
const overlay = document.createElement('div');
overlay.classList.add('signup-blocked-overlay');
const blockedMsg = errorJson.message || 'Signup Not Allowed';
overlay.innerHTML = `
<div class="signup-blocked-content">
<img src="${window.icons['logo.svg'] || window.icons['logo-white.svg'] || ''}" style="width:64px;margin-bottom:24px;" />
<p>${html_encode(blockedMsg)}</p>
<p>If you already have an account, try <a href="/action/login">logging in</a>. Otherwise, contact <a href="mailto:hi@puter.com">hi@puter.com</a> for assistance.</p>
</div>
`;
document.body.appendChild(overlay);
return;
}
// Handle timeout specifically
if ( errorJson?.code === 'response_timeout' || errorText.includes('timeout') ) {
$(el_window).find('.signup-error-msg').html(i18n('server_timeout') || 'The server took too long to respond. Please try again.');
+55
View File
@@ -2072,6 +2072,61 @@ label {
text-align: left;
}
.signup-blocked-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #f5f6f8;
z-index: 2147483647;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: #1a1a2e;
}
.signup-blocked-content {
padding: 48px 40px;
max-width: 460px;
display: flex;
flex-direction: column;
align-items: center;
background: #fff;
border-radius: 12px;
box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}
.signup-blocked-content h1 {
font-size: 22px;
font-weight: 600;
margin: 0 0 12px 0;
color: #1a1a2e;
}
.signup-blocked-content p {
font-size: 14px;
line-height: 1.6;
margin: 0 0 16px 0;
color: #555;
}
.signup-blocked-content p:last-child {
margin-bottom: 0;
}
.signup-blocked-content a {
color: #3a6ff7;
text-decoration: none;
font-weight: 500;
}
.signup-blocked-content a:hover {
text-decoration: underline;
}
.error {
display: none;
color: red;
+15
View File
@@ -1323,6 +1323,21 @@ window.initgui = async function (options) {
window.open('', '_self').close();
}
})();
} else if ( err_obj.code === 'signup_blocked' ) {
// Hide any captcha modal
$('.captcha-modal').hide();
const overlay = document.createElement('div');
overlay.classList.add('signup-blocked-overlay');
const blockedMsg = err_obj.message || 'Signup blocked';
overlay.innerHTML = `
<div class="signup-blocked-content">
<img src="${window.icons['logo.svg'] || window.icons['logo-white.svg'] || ''}" style="width:64px;margin-bottom:24px;" />
<p>${html_encode(blockedMsg)}</p>
<p>If you already have an account, try <a href="/action/login">logging in</a>. Otherwise, contact <a href="mailto:hi@puter.com">hi@puter.com</a> for assistance.</p>
</div>
`;
document.body.appendChild(overlay);
} else {
UIAlert({
message: err_obj.message ?? 'There was an error creating your account. Please try again.',