feat: мульти-пользовательская авторизация через invite + email

- SQLite: таблицы users (email, password_hash, role, verified) + invites
- auth.py: register_user, verify_email, hash_password + legacy env user
- email_service.py: SMTP Timeweb (smtp.timeweb.ru:465) — код подтверждения
- API: POST /api/register, /api/verify-email, /api/admin/invite
- UI: /register?invite=TOKEN — 3-шаговая регистрация
- Admin: кнопка создать приглашение, список invites + users
- Обратная совместимость: env user (smeta) = admin

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-27 15:44:43 +10:00
co-authored by Claude Opus 4.6
parent 144a592e5e
commit 0469dd85e7
7 changed files with 523 additions and 19 deletions
+2 -1
View File
@@ -107,9 +107,10 @@ body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Robo
<h2>Сметный ИИ</h2>
<span class="subtitle">Профессиональный ассистент</span>
<div id="login-error">Неверный логин или пароль</div>
<input type="text" id="login-user" placeholder="Логин" autocomplete="username" required>
<input type="text" id="login-user" placeholder="Email или логин" autocomplete="username" required>
<input type="password" id="login-pass" placeholder="Пароль" autocomplete="current-password" required>
<button type="submit">Войти</button>
<p style="text-align:center;margin-top:.8rem;font-size:.85rem;color:var(--text-muted)">Нет аккаунта? Попросите приглашение у администратора</p>
</form>
</div>