From e5dceb250bc931b54f978a03fc7a91e56f336b01 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2026 18:02:04 +0000 Subject: [PATCH] Debug register button: log to console, show clear error --- public/js/app.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 2b0e401..b953e15 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -223,18 +223,30 @@ const App = { TG_APP.showAlert('Email и пароль (≥8 символов) обязательны'); return; } + // disable на время запроса + const btn = document.getElementById('el-register'); + btn.disabled = true; + btn.textContent = 'Регистрация...'; try { - await API.Auth.registerEmail({ + console.log('registerEmail:', email); + const r = await API.Auth.registerEmail({ email, password: pass, name: email.split('@')[0], consents: { adult: true, terms: true, privacy: true, disclaimer: true }, }); + console.log('registerEmail result:', r); await API.Auth.me(); this.consentGiven = true; this.showView('map'); } catch (e) { - TG_APP.showAlert('Ошибка: ' + e.message); + console.error('registerEmail error:', e); + btn.disabled = false; + btn.textContent = 'Регистрация'; + // покажем ошибку явно + const msg = e?.message || 'unknown error'; + if (e?.data) console.error('error data:', e.data); + TG_APP.showAlert('Ошибка регистрации: ' + msg + '\n\nОткрой DevTools (F12) → Console для подробностей.'); } },