notherbase-fs 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/controllers/user.js
CHANGED
|
@@ -44,13 +44,12 @@ export default class User {
|
|
|
44
44
|
if (spirit) {
|
|
45
45
|
let token = Math.floor(Math.random() * 9999);
|
|
46
46
|
|
|
47
|
-
if (req.body.test) console.log("token: " + token);
|
|
48
|
-
|
|
49
47
|
spirit.memory.data.resetToken = token;
|
|
50
48
|
spirit.memory.data.resetExp = Date.now() + (1000 * 60 * 10);
|
|
51
49
|
await spirit.commit();
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
if (req.body.test) console.log("token: " + token);
|
|
52
|
+
else req.db.SendMail.passwordReset(req.body.email, token);
|
|
54
53
|
|
|
55
54
|
success(res, "Password reset token sent.");
|
|
56
55
|
}
|
package/models/send-mail.js
CHANGED
|
@@ -6,7 +6,10 @@ import nodemailer from "nodemailer";
|
|
|
6
6
|
* @param {Number} resetToken Token to reset by.
|
|
7
7
|
*/
|
|
8
8
|
const passwordReset = async (toEmail, resetToken) => {
|
|
9
|
-
return await send(toEmail, 'Password Reset for NotherBase',
|
|
9
|
+
return await send(toEmail, 'Password Reset for NotherBase',
|
|
10
|
+
`<h1>Your One-Time Password Reset Code:<h1>
|
|
11
|
+
<h2>${resetToken}<h2>
|
|
12
|
+
<p>Visit <a href="https://www.notherbase.com/the-front/keeper">notherbase.com/the-front/keeper</a> to finish changing your password.</p>`);
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
/**
|
package/package.json
CHANGED
package/views/explorer.ejs
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<input type="email" placeholder="user@email.com" id="email">
|
|
26
26
|
<input type="password" placeholder="password" id="pass">
|
|
27
27
|
<button id="login" onclick="coverLogin()">Login</button>
|
|
28
|
-
<
|
|
28
|
+
<a href="/the-front/keeper">Reset Password</a>
|
|
29
29
|
<p class="info"></p>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
@@ -38,14 +38,6 @@
|
|
|
38
38
|
if (response.status === "success") location.reload();
|
|
39
39
|
$(".login-cover .info").text(response.data);
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
const coverReset = async () => {
|
|
43
|
-
let response = await base.resetPassword(
|
|
44
|
-
$(".login-cover #email").val()
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
$(".login-cover .info").text(response.data);
|
|
48
|
-
};
|
|
49
41
|
</script>
|
|
50
42
|
</div>
|
|
51
43
|
<% } else { %>
|
|
File without changes
|
|
File without changes
|