Files
gh-christianlouis-leagueledger/app/templates/auth/login.html
T
Christian Krakau-Louis 5cf3f944b1 feat: Implement email functionality with FastAPI-Mail and Mailhog
- Updated docker-compose.yml to include Mailhog service for email testing.
- Added environment variables for email configuration in docker-compose.
- Updated requirements.txt to include fastapi-mail for email support.
- Created templates for password reset, email verification, and welcome emails.
- Developed mail utility module to handle sending emails using FastAPI-Mail.
- Added documentation for email testing with Mailhog.
2025-04-14 07:23:16 +02:00

116 lines
4.4 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="max-w-md mx-auto my-8">
<div class="bg-white p-8 rounded-lg shadow-md">
<h1 class="text-2xl font-bold text-irish-green mb-6 text-center">Log In</h1>
<!-- Messages/Alerts -->
{% if error %}
<div class="mb-4 p-3 rounded bg-red-100 text-red-700">
{{ error }}
<!-- Display resend verification link if applicable -->
{% if unverified_user_id %}
<div class="mt-2 p-2 border-t border-red-200">
<p class="mb-2 text-sm">Didn't receive the verification email?</p>
<a href="/auth/resend-verification?user_id={{ unverified_user_id }}"
class="text-irish-green hover:underline text-sm font-medium">
Resend verification email to {{ unverified_email }}
</a>
</div>
{% endif %}
</div>
{% endif %}
{% if message %}
<div class="mb-4 p-3 rounded bg-green-100 text-green-700">
{{ message }}
</div>
{% endif %}
<form action="/auth/login" method="post" class="space-y-4">
<div>
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Username</label>
<input
type="text"
id="username"
name="username"
required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<input
type="password"
id="password"
name="password"
required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
>
</div>
<!-- Debug info -->
<div class="text-xs text-gray-500">
<p>Having trouble logging in? Make sure your browser accepts cookies.</p>
</div>
<div class="flex items-center">
<input
type="checkbox"
id="remember"
name="remember"
class="h-4 w-4 text-irish-green focus:ring-irish-green border-gray-300 rounded"
>
<label for="remember" class="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<div class="flex items-center justify-between">
<button
type="submit"
class="bg-irish-green text-white py-2 px-4 rounded-md hover:bg-opacity-90 transition focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-irish-green"
>
Log In
</button>
<a class="inline-block align-baseline font-bold text-sm text-irish-green hover:text-opacity-75" href="/auth/forgot-password">
Forgot Password?
</a>
</div>
</form>
<div class="mt-6 pt-6 border-t border-gray-200 text-center">
<p class="text-gray-600">Don't have an account?</p>
<a href="/auth/register" class="block mt-2 bg-cream-white text-irish-green border border-irish-green py-2 px-4 rounded-md hover:bg-irish-green hover:text-white transition">
Create an account
</a>
</div>
<!-- OAuth login options -->
{% if show_oauth %}
<div class="mt-6 pt-6 border-t border-gray-200">
<p class="text-center text-gray-600 mb-4">Or sign in with</p>
<div class="flex justify-center">
<a href="/auth/oauth-login" class="bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-opacity-90 transition w-full flex items-center justify-center">
<i class="fas fa-sign-in-alt mr-2"></i> Authentik
</a>
</div>
</div>
{% else %}
<div class="mt-6 pt-6 border-t border-gray-200">
<p class="text-center text-gray-600 mb-4">Or sign in with</p>
<div class="flex justify-center space-x-4">
<button class="bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-opacity-90 transition w-full disabled:opacity-50" disabled>
<i class="fab fa-google mr-2"></i> Google
</button>
<button class="bg-gray-800 text-white py-2 px-4 rounded-md hover:bg-opacity-90 transition w-full disabled:opacity-50" disabled>
<i class="fab fa-github mr-2"></i> GitHub
</button>
</div>
<p class="text-center text-gray-500 text-xs mt-2">OAuth login currently disabled</p>
</div>
{% endif %}
</div>
</div>
{% endblock %}