agnes-the-ai-analyst/webapp/templates/login_magic_link.html
Petr f635195c80 Add multi-domain support and full-email username generation
- Support comma-separated domains in auth.allowed_domain config
- Use full email as system username (user@domain.com -> user_domain_com)
  to avoid collisions with reserved names and across domains
- Update both auth providers (google, email) for multi-domain display
- Add tests for username generation and update email auth tests
2026-03-10 10:50:01 +01:00

59 lines
2.5 KiB
HTML

{% extends "base_login.html" %}
{% block title %}Sign in with Email - {{ config.INSTANCE_NAME }}{% endblock %}
{% block content %}
<div class="login-page">
<div class="login-split">
<div class="login-features">
<div class="features-content">
<h1 class="features-title">{{ config.INSTANCE_NAME }}</h1>
<p class="features-subtitle">
Enter your email address and we'll send you a sign-in link.
</p>
</div>
</div>
<div class="login-card-wrapper">
<div class="login-card">
<h2>Sign In with Email</h2>
<p class="login-description">
We'll send a magic link to your email. Click it to sign in &mdash; no password needed.
</p>
<form method="POST" action="{{ url_for('email_auth.send_magic_link') }}" class="login-form" style="width: 100%; max-width: 320px;">
<div class="form-group" style="margin-bottom: 16px;">
<label for="email" style="display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px;">Email Address</label>
<input type="email"
id="email"
name="email"
placeholder="you@{{ allowed_domains[0] if allowed_domains else 'company.com' }}"
required
autocomplete="email"
autofocus
style="width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 15px; box-sizing: border-box;">
</div>
<button type="submit" class="btn btn-primary" style="width: 100%;">
Send Sign-In Link
</button>
</form>
{% if allowed_domains %}
<p class="login-note">
For {% for d in allowed_domains %}<strong>@{{ d }}</strong>{% if not loop.last %}, {% endif %}{% endfor %} email addresses.
</p>
{% endif %}
<div class="divider">
<span>or</span>
</div>
<a href="{{ url_for('auth.login') }}" class="btn btn-secondary" style="width: 100%; max-width: 280px;">
Back to Login
</a>
</div>
</div>
</div>
</div>
{% endblock %}