diff --git a/src/auth/forgotPass.js b/src/auth/forgotPass.js index 424c633..c78aa80 100644 --- a/src/auth/forgotPass.js +++ b/src/auth/forgotPass.js @@ -3,7 +3,9 @@ const crypto = require('crypto'); const joi = require('joi'); const nodeMail = require('nodemailer'); const bcrypt = require('bcrypt'); +const path = require('path'); require('dotenv').config(); +const PATH = path.join(__dirname, '..', 'public', 'images', 'wallet.png'); const PORT = process.env.PORT; @@ -40,7 +42,7 @@ module.exports = (users) => { const token = crypto.randomBytes(32).toString('hex'); console.log(`The reset token is ${token}`) - const expiration = Date.now() + 360000; + const expiration = Date.now() + 3600000; await users.updateOne({ email }, { $set: { resetToken: token, resetTokenExpires: expiration } @@ -52,8 +54,13 @@ module.exports = (users) => { from: process.env.EMAIL_USER, to: email, subject: 'Password reset', - text: `reset your password here ${resetUrl} this link will expire within 1 hour`, - + text: `reset your password here ${resetUrl} this link will expire within 1 hour, \n Do not share this link with anyone + \n \n Thankyou, The RCalculator team.`, + html: ` +

Reset your password here. This link will expire in 1 hour.

+

wallet icon

+

Thank you,
The RCalculator team

`, + }; try { diff --git a/src/public/images/wallet.png b/src/public/images/wallet.png new file mode 100644 index 0000000..054652b Binary files /dev/null and b/src/public/images/wallet.png differ diff --git a/src/views/dashboard.ejs b/src/views/dashboard.ejs index d306208..a8956e6 100644 --- a/src/views/dashboard.ejs +++ b/src/views/dashboard.ejs @@ -13,9 +13,27 @@
- <% plans.forEach(plan=> { %> + + <% if (plans.length === 0) { %> +
+
+

Don't have any retirement plans?

+
+
+ Make one +
+
+
+
+ + <% } %> + <% plans.forEach(plan=> { %> <%- include('./partials/dashboardBox.ejs', {thing: plan}) %> <% }); %> +