0de2eb5830
- Added authentication routes for login, registration, password reset, and account deletion in `auth.py`. - Implemented user profile management, including updating user information and changing passwords. - Created dashboard views to display user-specific information and recent activity in `dashboard.py`. - Developed leaderboard views to show team rankings and points in `leaderboard.py`. - Added QR code generation and redemption functionality in `qr.py` and `redeem.py`. - Implemented team management features, allowing users to create and join teams in `teams.py`. - Introduced session debugging utility to assist with session-related issues in `debug_session.py`. - Configured Docker Compose for MySQL database and FastAPI application with environment variables. - Updated requirements.txt to include necessary dependencies for the application.
94 lines
3.5 KiB
HTML
94 lines
3.5 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 messages %}
|
|
{% for message in messages %}
|
|
<div class="mb-4 p-3 rounded {% if message.type == 'error' %}bg-red-100 text-red-700{% else %}bg-green-100 text-green-700{% endif %}">
|
|
{{ message.text }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
<form action="/auth/login" method="post" class="space-y-4">
|
|
<input type="hidden" name="next" value="{{ next }}">
|
|
|
|
<div>
|
|
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Username or Email</label>
|
|
<input
|
|
type="text"
|
|
id="username"
|
|
name="username"
|
|
value="{{ username or '' }}"
|
|
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>
|
|
<button
|
|
type="submit"
|
|
class="w-full 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>
|
|
</div>
|
|
|
|
<div class="text-center text-sm mt-4">
|
|
<a href="/auth/forgot-password" class="text-irish-green hover:text-opacity-80">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 (to be implemented later) -->
|
|
<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 coming soon</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|