mirror of
https://github.com/lightningcell/flask-2fa-auth.git
synced 2026-05-30 17:09:38 +00:00
- Added `track_login_location` function to monitor user login locations. - Introduced `LoginLocation` model to store login details including IP and geolocation. - Created `LocationApprovalToken` model for managing location approval tokens. - Enhanced OTP verification to include location tracking and alerts for suspicious logins. - Implemented email notifications for suspicious login attempts and location approvals. - Added `login_history` route to display user's login activity. - Updated templates for login history and email notifications. - Configured mail settings and added dependencies for email functionality. - Introduced utility classes for mail and location services.
83 lines
2.7 KiB
HTML
83 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login Location Approved</title>
|
|
<style>
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
line-height: 1.6;
|
|
color: #333;
|
|
margin: 0;
|
|
padding: 0;
|
|
background-color: #f8f9fa;
|
|
}
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
background-color: #ffffff;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
}
|
|
.header {
|
|
background-color: #28a745;
|
|
color: white;
|
|
padding: 20px;
|
|
border-radius: 8px 8px 0 0;
|
|
text-align: center;
|
|
margin: -20px -20px 20px -20px;
|
|
}
|
|
.success-icon {
|
|
font-size: 48px;
|
|
margin-bottom: 10px;
|
|
}
|
|
.location-info {
|
|
background-color: #d4edda;
|
|
padding: 15px;
|
|
border-radius: 5px;
|
|
margin: 15px 0;
|
|
border-left: 4px solid #28a745;
|
|
}
|
|
.footer {
|
|
text-align: center;
|
|
margin-top: 30px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid #dee2e6;
|
|
color: #6c757d;
|
|
font-size: 12px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<div class="success-icon">✅</div>
|
|
<h1>Location Approved Successfully</h1>
|
|
</div>
|
|
|
|
<p>Hello <strong>{{ user_name }}</strong>,</p>
|
|
|
|
<p>Thank you for approving the new login location for your {{ app_name }} account.</p>
|
|
|
|
<div class="location-info">
|
|
<h3>📍 Approved Location:</h3>
|
|
<ul>
|
|
<li><strong>Location:</strong> {{ location.city or 'Unknown' }}{% if location.region %}, {{ location.region }}{% endif %}{% if location.country %}, {{ location.country }}{% endif %}</li>
|
|
<li><strong>Approved at:</strong> {{ approval_time }}</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<p>This location has been added to your list of trusted locations. Future logins from this location will not require additional approval.</p>
|
|
|
|
<p><strong>Security Reminder:</strong> If you did not approve this location, please contact support immediately and change your password.</p>
|
|
|
|
<div class="footer">
|
|
<p>This email was sent from {{ app_name }} security system.</p>
|
|
<p>© 2025 {{ app_name }}. All rights reserved.</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|