127 lines
4.9 KiB
HTML
127 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% if success %}Authorization Successful{% else %}Authorization Failed{% endif %} - QBO Excel Sync</title>
|
|
<style>
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
.card {
|
|
background: white;
|
|
border-radius: 16px;
|
|
padding: 48px;
|
|
max-width: 480px;
|
|
width: 100%;
|
|
text-align: center;
|
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
}
|
|
.icon {
|
|
width: 80px;
|
|
height: 80px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0 auto 24px;
|
|
}
|
|
.icon.success { background: #d1fae5; color: #059669; }
|
|
.icon.error { background: #fee2e2; color: #dc2626; }
|
|
.icon svg { width: 40px; height: 40px; }
|
|
h1 { font-size: 24px; margin-bottom: 12px; color: #1f2937; }
|
|
p { color: #6b7280; margin-bottom: 24px; line-height: 1.6; }
|
|
.error-msg { background: #fef2f2; color: #dc2626; padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 24px; }
|
|
.btn {
|
|
display: inline-block;
|
|
background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
|
|
color: white;
|
|
padding: 12px 32px;
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
border: none;
|
|
font-size: 16px;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4); }
|
|
.auto-close { font-size: 12px; color: #9ca3af; margin-top: 24px; }
|
|
.countdown { font-weight: bold; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="card">
|
|
{% if success %}
|
|
<div class="icon success">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>
|
|
<polyline points="22 4 12 14.01 9 11.01"/>
|
|
</svg>
|
|
</div>
|
|
<h1>Authorization Successful!</h1>
|
|
<p>You have successfully connected to QuickBooks Online.</p>
|
|
<button type="button" class="btn" onclick="closeAndRefresh()">Close & Continue</button>
|
|
<p class="auto-close">This window will close automatically in <span class="countdown" id="countdown">5</span> seconds...</p>
|
|
|
|
<script>
|
|
// Signal OAuth success via localStorage
|
|
try {
|
|
localStorage.setItem('oauth_complete', Date.now().toString());
|
|
console.log('OAuth complete flag set in localStorage');
|
|
} catch (e) {
|
|
console.error('Failed to set localStorage:', e);
|
|
}
|
|
|
|
// Countdown timer
|
|
let seconds = 5;
|
|
const countdownEl = document.getElementById('countdown');
|
|
const countdownTimer = setInterval(function() {
|
|
seconds--;
|
|
countdownEl.textContent = seconds;
|
|
if (seconds <= 0) {
|
|
clearInterval(countdownTimer);
|
|
closeAndRefresh();
|
|
}
|
|
}, 1000);
|
|
|
|
// Close popup and trigger parent refresh
|
|
function closeAndRefresh() {
|
|
// Try to close the popup
|
|
try {
|
|
window.close();
|
|
} catch (e) {
|
|
console.log('Could not close window:', e);
|
|
}
|
|
|
|
// If window didn't close, redirect to connection page
|
|
setTimeout(function() {
|
|
window.location.href = '/connection';
|
|
}, 500);
|
|
}
|
|
</script>
|
|
{% else %}
|
|
<div class="icon error">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="12" cy="12" r="10"/>
|
|
<line x1="15" y1="9" x2="9" y2="15"/>
|
|
<line x1="9" y1="9" x2="15" y2="15"/>
|
|
</svg>
|
|
</div>
|
|
<h1>Authorization Failed</h1>
|
|
<p>We couldn't complete the authorization with QuickBooks Online.</p>
|
|
{% if error %}
|
|
<div class="error-msg">{{ error }}</div>
|
|
{% endif %}
|
|
<a href="/connection" class="btn">Try Again</a>
|
|
{% endif %}
|
|
</div>
|
|
</body>
|
|
</html> |