error.html•5.8 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }} - Vivint OAuth</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.error-container {
background: white;
border-radius: 12px;
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
max-width: 500px;
width: 100%;
overflow: hidden;
}
.error-header {
background: #c53030;
color: white;
padding: 30px;
text-align: center;
}
.error-icon {
width: 60px;
height: 60px;
background: rgba(255,255,255,0.2);
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
font-size: 28px;
}
.error-header h1 {
font-size: 24px;
margin-bottom: 8px;
}
.error-header p {
opacity: 0.9;
font-size: 16px;
}
.error-body {
padding: 30px;
text-align: center;
}
.error-message {
background: #fed7d7;
border: 2px solid #feb2b2;
color: #c53030;
padding: 20px;
border-radius: 8px;
margin-bottom: 25px;
font-size: 16px;
line-height: 1.5;
}
.error-details {
background: #f7fafc;
padding: 15px;
border-radius: 6px;
margin-bottom: 25px;
font-family: 'Courier New', monospace;
font-size: 14px;
color: #4a5568;
text-align: left;
}
.action-buttons {
display: flex;
gap: 15px;
justify-content: center;
flex-wrap: wrap;
}
.btn {
padding: 12px 24px;
border-radius: 6px;
text-decoration: none;
font-weight: 600;
font-size: 14px;
transition: all 0.2s;
border: none;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn-primary {
background: #4299e1;
color: white;
}
.btn-primary:hover {
background: #3182ce;
}
.btn-secondary {
background: #e2e8f0;
color: #4a5568;
}
.btn-secondary:hover {
background: #cbd5e0;
}
.help-text {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #e2e8f0;
color: #718096;
font-size: 14px;
line-height: 1.6;
}
.help-text a {
color: #4299e1;
text-decoration: none;
}
.help-text a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="error-container">
<div class="error-header">
<div class="error-icon">⚠️</div>
<h1>{{ title }}</h1>
<p>Something went wrong with your authorization request</p>
</div>
<div class="error-body">
<div class="error-message">
{{ message }}
</div>
<div class="action-buttons">
<button onclick="history.back()" class="btn btn-secondary">
← Go Back
</button>
<a href="/authorize{% if request.query_params %}?{{ request.query_params }}{% endif %}" class="btn btn-primary">
🔄 Try Again
</a>
</div>
<div class="help-text">
<p><strong>Common issues:</strong></p>
<ul style="text-align: left; margin-top: 10px;">
<li>Invalid Vivint username or password</li>
<li>Two-factor authentication code expired</li>
<li>Client application not properly configured</li>
<li>Network connectivity issues</li>
</ul>
<p style="margin-top: 15px;">
If the problem persists, please check your Vivint account status and
ensure your credentials are correct. You may also want to verify that
two-factor authentication is properly set up on your account.
</p>
</div>
</div>
</div>
<script>
// Auto-redirect after timeout for certain errors
const message = "{{ message }}".toLowerCase();
const shouldAutoRedirect = message.includes('session expired') || message.includes('timeout');
if (shouldAutoRedirect) {
setTimeout(() => {
const urlParams = new URLSearchParams(window.location.search);
window.location.href = '/authorize?' + urlParams.toString();
}, 5000);
}
</script>
</body>
</html>