-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset_password.html
More file actions
131 lines (128 loc) · 5.38 KB
/
reset_password.html
File metadata and controls
131 lines (128 loc) · 5.38 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Dydra.com — Reset Password" />
<meta name="author" content="Dydra" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Forgot your password? — Dydra</title>
<link rel="shortcut icon" href="./favicon.ico" />
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
<link rel="stylesheet" href="./stylesheets/style.css" media="screen" />
<link rel="stylesheet" href="./stylesheets/jsui-overrides.css" media="screen" />
</head>
<body class="devise passwords new">
<div id="header">
<div class="wrapper">
<a href="/" id="logo">Dydra</a>
<div id="nav">
<ul class="nav">
<li><a href="http://docs.dydra.com/dydra">About</a></li>
<li><a href="http://docs.dydra.com">Documentation</a></li>
<li><a href="http://blog.dydra.com">Blog</a></li>
<li><a href="/login">Login</a></li>
</ul>
</div>
</div>
</div>
<div id="main">
<div id="main-0">
<div class="wrapper">
<div id="content">
<h1 id="content-title">Forgot your password?</h1>
<div id="error-messages" class="widget" style="display:none;">
<div class="alert-error rounded">
<p class="message">
<span class="icon icon-alert"></span>
<span id="error-text"></span>
</p>
</div>
</div>
<div id="success-message" class="widget" style="display:none;">
<div class="alert-success rounded" style="padding:8px;">
<p class="message">
<span id="success-text"></span>
</p>
</div>
</div>
<form id="reset-password-form" class="formtastic" action="/accounts/password" method="post">
<fieldset class="inputs">
<ol>
<li class="email optional">
<label for="account_email">Email address</label>
<input type="email" id="account_email" name="account[email]" required />
</li>
</ol>
</fieldset>
<fieldset class="buttons">
<ol>
<li class="commit"><input type="submit" value="Submit" /></li>
</ol>
</fieldset>
</form>
</div>
<div id="aside">
<h5>Already have an account?</h5>
<p><a href="/login">Log in</a></p>
<h5>Have an invite code?</h5>
<p><a href="/signup">Register now</a></p>
<a href="/confirmations/new">Didn't receive confirmation instructions?</a><br />
<a href="/unlocks/new">Didn't receive unlock instructions?</a>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="wrapper">
<p id="copyright">
A product of <a href="http://datagraph.org/">Datagraph, Inc.</a>
• <span><a href="http://docs.dydra.com/dydra">About</a></span>
• <span><a href="http://docs.dydra.com">Documentation</a></span>
• <span><a href="http://blog.dydra.com">Blog</a></span>
• <span><a href="/legal">Legal</a></span>
</p>
<p id="footer-links">
<a href="https://github.com/dydra/support/blob/master/README.rst#readme">Support</a>
•
<a href="https://github.com/dydra">GitHub</a>
•
<a href="http://twitter.com/dydradata">Twitter</a>
•
<a href="http://feeds.feedburner.com/dydra">RSS</a>
</p>
</div>
</div>
<script>
document.getElementById("reset-password-form").addEventListener("submit", async function (e) {
e.preventDefault();
var form = this;
var errorBox = document.getElementById("error-messages");
var errorText = document.getElementById("error-text");
var successBox = document.getElementById("success-message");
var successText = document.getElementById("success-text");
errorBox.style.display = "none";
successBox.style.display = "none";
var email = document.getElementById("account_email").value;
if (!email) return;
try {
var response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded", "Accept": "text/html" },
body: "account%5Bemail%5D=" + encodeURIComponent(email),
});
if (response.ok || response.status === 302 || response.status === 303) {
successBox.style.display = "block";
successText.textContent = "If an account exists for " + email + ", you will receive password reset instructions shortly.";
form.style.display = "none";
} else {
errorBox.style.display = "block";
errorText.textContent = "Could not process your request. Please verify your email address and try again.";
}
} catch (err) {
errorBox.style.display = "block";
errorText.textContent = "Could not reach the server. Please try again later.";
}
});
</script>
</body>
</html>