-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset.html
More file actions
60 lines (60 loc) · 4.13 KB
/
Copy pathreset.html
File metadata and controls
60 lines (60 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://nftw-auth.nightmareftw.workers.dev https://api.github.com https://github.com https://api.warframestat.us https://cloudflareinsights.com; frame-src https://outlast.fex.dev; object-src 'none'; base-uri 'self'; form-action 'self';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reset password · NightmareFTW</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;800&family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="assets/css/style.css?v=ebe4a175">
</head>
<body>
<div class="bg-grid" aria-hidden="true"></div>
<header class="site-header">
<div class="container">
<a class="brand" href="index.html"><span class="brand-mark">▲</span><span class="brand-name">Nightmare<span class="accent">FTW</span></span></a>
<nav class="top-nav"><a href="index.html">Hub</a></nav>
</div>
</header>
<main class="container tool-page">
<h1>Reset your password</h1>
<div class="panel" style="max-width:380px">
<form id="reset-form" style="display:flex;flex-direction:column;gap:12px">
<label style="display:flex;flex-direction:column;gap:5px;font-size:.78rem;color:var(--muted);font-weight:600">New password
<input type="password" name="password" minlength="8" autocomplete="new-password" required
style="padding:9px 11px;border-radius:9px;border:1px solid var(--border);background:var(--bg);color:var(--text);font-size:.92rem">
</label>
<p id="reset-msg" style="margin:0;font-size:.82rem;line-height:1.4"></p>
<button type="submit" class="btn">Set new password</button>
</form>
</div>
<p class="tool-note">The link is valid for 1 hour. After resetting, sign in from the hub with your new password.</p>
</main>
<footer class="site-footer"><div class="container"><span>Built by NightmareFTW.</span></div></footer>
<script>
(function () {
var WORKER = "https://nftw-auth.nightmareftw.workers.dev";
var token = new URLSearchParams(location.search).get("token") || "";
var form = document.getElementById("reset-form");
var msg = document.getElementById("reset-msg");
function say(text, ok) { msg.textContent = text; msg.style.color = ok ? "#5bd6a0" : "#ff8a82"; }
if (!token) { say("This reset link is missing its token — request a new one from the sign-in window.", false); form.querySelector("button").disabled = true; }
form.addEventListener("submit", async function (e) {
e.preventDefault();
var pw = form.password.value;
if (pw.length < 8) return say("Password must be at least 8 characters.", false);
var btn = form.querySelector("button"); btn.disabled = true;
try {
var r = await fetch(WORKER + "/auth/reset", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token: token, password: pw }) });
var d = await r.json().catch(function () { return {}; });
if (r.ok && d.ok) { say("Password updated. You can now sign in with it from the hub.", true); form.querySelector("input").disabled = true; }
else { btn.disabled = false; say(d.error === "invalid_token" ? "This reset link is invalid or has expired — request a new one." : "Couldn't reset the password. Try again.", false); }
} catch (err) { btn.disabled = false; say("Network error — please try again.", false); }
});
})();
</script>
<!-- Cloudflare Web Analytics --><script type='module' src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "b0fc25d6ec3948f58b0a240fab9e9500"}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>