diff --git a/frontend/js/app.js b/frontend/js/app.js
index b369bce..9b75250 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -107,16 +107,20 @@ function initAuth() {
if (isLoginMode) {
const res = await api.login(username, password);
localStorage.setItem('token', res.token);
+ // Сразу показываем приложение без перезагрузки
+ currentUser = await api.getMe();
+ const planBadge = currentUser.plan === 'pro' ? '[PRO]' : '[FREE]';
+ document.getElementById('username-display').innerHTML = `Привет, ${currentUser.username} ${planBadge}`;
+ showApp();
+ if (window.lucide) lucide.createIcons();
} else {
await api.register(username, password);
- alert('Регистрация успешна! Теперь вы можете войти.');
isLoginMode = true;
title.textContent = 'Вход в систему';
toggleBtn.textContent = 'Нет аккаунта? Зарегистрироваться';
submitBtn.textContent = 'Войти';
- return;
+ showToast('Регистрация успешна! Войдите в систему.', 'success');
}
- window.location.reload();
} catch (err) {
alert(err.message);
}