Files
flask-2fa-auth/app/templates/auth/login.html
2025-05-30 00:07:07 +03:00

95 lines
3.9 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-6">
<div class="auth-form">
<h2 class="text-center mb-4">
<i class="bi bi-box-arrow-in-right"></i> Sign In
</h2>
<div class="security-notice">
<strong>Security Notice:</strong> This application uses two-factor authentication.
After entering your credentials, you'll need to provide a code from your authenticator app.
</div>
<form method="POST" novalidate>
{{ form.hidden_tag() }}
<!-- Username field -->
<div class="mb-3">
{{ form.username.label(class="form-label") }}
{{ form.username(class="form-control" + (" is-invalid" if form.username.errors else ""),
placeholder="Enter your username") }}
{% if form.username.errors %}
<div class="invalid-feedback">
{% for error in form.username.errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
</div>
<!-- Password field -->
<div class="mb-3">
{{ form.password.label(class="form-label") }}
{{ form.password(class="form-control" + (" is-invalid" if form.password.errors else ""),
placeholder="Enter your password") }}
{% if form.password.errors %}
<div class="invalid-feedback">
{% for error in form.password.errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
</div>
<!-- Remember me checkbox -->
<div class="mb-3 form-check">
{{ form.remember_me(class="form-check-input") }}
{{ form.remember_me.label(class="form-check-label") }}
<div class="form-text">Keep me logged in on this device</div>
</div>
<!-- Submit button -->
<div class="d-grid">
{{ form.submit(class="btn btn-primary btn-lg") }}
</div>
</form>
<hr class="my-4">
<div class="text-center">
<p>Don't have an account?
<a href="{{ url_for('auth.register') }}" class="text-decoration-none">Register here</a>
</p>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-header">
<h5><i class="bi bi-shield-lock"></i> Login Process</h5>
</div>
<div class="card-body">
<ol>
<li>Enter your username and password</li>
<li>If credentials are valid, you'll be redirected to 2FA verification</li>
<li>Open your authenticator app (Google Authenticator, Authy, etc.)</li>
<li>Enter the 6-digit code from your app</li>
<li>Access granted to your secure dashboard</li>
</ol>
<div class="alert alert-info mt-3">
<i class="bi bi-info-circle"></i>
<strong>Security Tip:</strong> Never share your authentication codes with anyone.
They expire every 30 seconds for your protection.
</div>
</div>
</div>
</div>
</div>
{% endblock %}