diff --git a/src/gui/src/UI/UIWindowSignup.js b/src/gui/src/UI/UIWindowSignup.js index 6f6f8b6dd..f0a4df075 100644 --- a/src/gui/src/UI/UIWindowSignup.js +++ b/src/gui/src/UI/UIWindowSignup.js @@ -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 = ` +
+ +

${html_encode(blockedMsg)}

+

If you already have an account, try logging in. Otherwise, contact hi@puter.com for assistance.

+
+ `; + 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.'); diff --git a/src/gui/src/css/style.css b/src/gui/src/css/style.css index 04dde8a20..4cfcd7815 100644 --- a/src/gui/src/css/style.css +++ b/src/gui/src/css/style.css @@ -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; diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index c0d23a197..42c75d931 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -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 = ` +
+ +

${html_encode(blockedMsg)}

+

If you already have an account, try logging in. Otherwise, contact hi@puter.com for assistance.

+
+ `; + document.body.appendChild(overlay); } else { UIAlert({ message: err_obj.message ?? 'There was an error creating your account. Please try again.',