Pre-github

This commit is contained in:
Jason
2026-04-24 14:09:04 -05:00
parent 7a2fffd62e
commit fcaa15bf6e
68 changed files with 707 additions and 10574 deletions
+7 -49
View File
@@ -3,14 +3,10 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - CGW Product Finder</title>
<title>Login</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@@ -113,27 +109,6 @@
border-left: 4px solid #f56565;
}
.alert-info {
background: #bee3f8;
color: #2c5282;
border-left: 4px solid #4299e1;
}
.footer-links {
text-align: center;
margin-top: 20px;
font-size: 14px;
}
.footer-links a {
color: #667eea;
text-decoration: none;
}
.footer-links a:hover {
text-decoration: underline;
}
.loading-spinner {
border: 3px solid #f3f3f3;
border-top: 3px solid #667eea;
@@ -156,7 +131,7 @@
<body>
<div class="login-container">
<div class="login-header">
<h1>🔐 CGW Product Finder</h1>
<h1>🔐 Login</h1>
<p>Please sign in to continue</p>
</div>
@@ -180,16 +155,9 @@
<span class="loading-spinner" id="loadingSpinner"></span>
</button>
</form>
<div class="footer-links">
<a href="{{ url_for('user_manager') }}">User Management</a>
</div>
</div>
<script>
// Base URL for API calls (supports subdirectory deployments)
const BASE_URL = '{{ base_url }}';
document.getElementById('loginForm').addEventListener('submit', async (e) => {
e.preventDefault();
@@ -198,12 +166,11 @@
const loginBtn = document.getElementById('loginBtn');
const spinner = document.getElementById('loadingSpinner');
// Disable button and show spinner
loginBtn.disabled = true;
spinner.style.display = 'inline-block';
try {
const response = await fetch(BASE_URL + '/api/login', {
const response = await fetch('/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -216,11 +183,9 @@
if (data.status === 'success') {
// Check if user needs to select a location
if (data.requiresLocationSelection) {
// Redirect to location selection page
window.location.href = '/select-location';
window.location.href = '{{ url_for("auth.select_location_page") }}';
} else {
// Redirect to main app
window.location.href = '/';
window.location.href = '{{ url_for("products.product_finder") }}';
}
} else {
showAlert(data.message || 'Invalid username or password');
@@ -243,13 +208,6 @@
alert.classList.remove('show');
}, 5000);
}
// Check if there's a message in URL (e.g., after logout)
const urlParams = new URLSearchParams(window.location.search);
const message = urlParams.get('message');
if (message) {
showAlert(message);
}
</script>
</body>
</html>