69 lines
2.6 KiB
HTML
69 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Set New Password — Website Checker</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
|
</head>
|
|
<body class="login-wrap">
|
|
<div class="login-box">
|
|
|
|
<div class="login-logo">
|
|
<span class="brand-icon">🌐</span>
|
|
<h1>Website Checker</h1>
|
|
<p>Set New Password</p>
|
|
</div>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% for cat, msg in messages %}
|
|
<div class="alert alert-{{ cat }} mb-2">{{ msg }}</div>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
|
|
<form method="post" action="{{ url_for('auth.reset_password', token=token) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<div class="form-group">
|
|
<label for="password">New Password</label>
|
|
<input type="password" id="password" name="password"
|
|
autofocus required minlength="8"
|
|
placeholder="Minimum 8 characters">
|
|
<div class="pw-strength-wrap">
|
|
<div class="pw-strength-bar"><div class="pw-strength-fill" id="pw-fill"></div></div>
|
|
<small class="pw-strength-label" id="pw-label"></small>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="confirm_password">Confirm Password</label>
|
|
<input type="password" id="confirm_password" name="confirm_password"
|
|
required placeholder="Repeat new password">
|
|
</div>
|
|
<button class="btn btn-primary w-full" type="submit">Set New Password</button>
|
|
</form>
|
|
|
|
<p style="text-align:center;margin-top:1rem;font-size:.875rem">
|
|
<a href="{{ url_for('auth.login') }}" style="color:var(--accent)">Back to sign in</a>
|
|
</p>
|
|
|
|
</div>
|
|
<script>
|
|
(function() {
|
|
var input = document.getElementById('password');
|
|
var fill = document.getElementById('pw-fill');
|
|
var lbl = document.getElementById('pw-label');
|
|
var map = ['pw-weak','pw-weak','pw-fair','pw-strong','pw-great','pw-great'];
|
|
var lbls = ['Weak','Weak','Fair','Strong','Very strong','Very strong'];
|
|
input.addEventListener('input', function() {
|
|
if (!this.value) { fill.className='pw-strength-fill'; lbl.className='pw-strength-label'; lbl.textContent=''; return; }
|
|
var pw=this.value, s=0;
|
|
if (pw.length>=8) s++; if (pw.length>=12) s++;
|
|
if (/[A-Z]/.test(pw)) s++; if (/[0-9]/.test(pw)) s++; if (/[^A-Za-z0-9]/.test(pw)) s++;
|
|
fill.className='pw-strength-fill '+map[s];
|
|
lbl.className='pw-strength-label '+map[s];
|
|
lbl.textContent=lbls[s];
|
|
});
|
|
}());
|
|
</script>
|
|
</body>
|
|
</html>
|