forked from Nixius/authelia
1
0
Fork 0
ATLAS/docker/ss-atlas/templates/pages/success.html

153 lines
5.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>a250.ca - Welcome</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0f1117;
--surface: #1a1d27;
--border: #2a2d3a;
--text: #e4e4e7;
--muted: #a1a1aa;
--accent: #6366f1;
--accent-hover: #818cf8;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
}
.container { max-width: 480px; width: 100%; }
.logo { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 0.5rem; }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 2rem;
}
.card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
.card p { color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.card ul { color: var(--muted); line-height: 1.7; margin: 1rem 0; padding-left: 1.25rem; }
.footer { margin-top: 2rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
.footer a { color: var(--accent); text-decoration: none; }
.resend { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.resend p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.resend .btn-outline {
background: transparent;
border: 1px solid var(--accent);
color: var(--accent);
padding: 0.5rem 1rem;
font-size: 0.9rem;
border-radius: 6px;
cursor: pointer;
transition: opacity 0.2s;
}
.resend .btn-outline:hover:not(:disabled) { opacity: 0.9; }
.resend .btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.resend .msg { font-size: 0.85rem; margin-top: 0.5rem; }
.resend .msg.success { color: var(--green, #22c55e); }
.resend .msg.error { color: #ef4444; }
</style>
{{template "analytics"}}
</head>
<body>
<div class="container">
<div class="logo">a250.ca</div>
<div class="card">
<h2>Check your inbox</h2>
<p>We've sent a password set email to your address. Use the link in that email to create your password and sign in.</p>
<p><strong>You'll be required to:</strong></p>
<ul>
<li>Set a password</li>
<li>Enable two-factor authentication or a passkey</li>
</ul>
<p>Once you've signed in, you can activate your workspace from the dashboard.</p>
{{if .Username}}
<div class="resend">
<p>Didn't get the email?</p>
<form id="resend-form">
<input type="hidden" name="username" value="{{.Username}}">
<button type="submit" class="btn-outline" id="resend-btn" disabled>Resend (60s)</button>
</form>
<p class="msg" id="resend-msg"></p>
</div>
{{end}}
</div>
<div class="footer">
<a href="{{.AppURL}}/dashboard">Go to Dashboard</a>
</div>
</div>
{{if .Username}}
<script>
(function() {
var form = document.getElementById('resend-form');
var btn = document.getElementById('resend-btn');
var msg = document.getElementById('resend-msg');
var cooldown = 60, interval;
function setCooldown(sec) {
cooldown = sec;
btn.disabled = true;
btn.textContent = 'Resend (' + sec + 's)';
if (interval) clearInterval(interval);
interval = setInterval(function() {
cooldown--;
if (cooldown <= 0) {
clearInterval(interval);
btn.disabled = false;
btn.textContent = 'Resend';
return;
}
btn.textContent = 'Resend (' + cooldown + 's)';
}, 1000);
}
setCooldown(60);
form.addEventListener('submit', function(e) {
e.preventDefault();
btn.disabled = true;
msg.textContent = '';
fetch('/resend-reset', {
method: 'POST',
body: new FormData(form),
headers: { 'X-Requested-With': 'XMLHttpRequest' }
}).then(function(r) {
return r.json().then(function(data) {
if (data.ok) {
msg.textContent = data.message;
msg.className = 'msg success';
setCooldown(60);
} else if (data.retry_after_seconds) {
msg.textContent = data.error + ' Try again in ' + data.retry_after_seconds + 's.';
msg.className = 'msg error';
setCooldown(data.retry_after_seconds);
} else {
msg.textContent = data.error;
msg.className = 'msg error';
btn.disabled = false;
btn.textContent = 'Resend';
}
});
}).catch(function() {
msg.textContent = 'Something went wrong. Please try again.';
msg.className = 'msg error';
btn.disabled = false;
btn.textContent = 'Resend';
});
});
})();
</script>
{{end}}
</body>
</html>