Compare commits

..
Author SHA1 Message Date
Joaquin 4ee885ac57 fix/reorganized scripts called in ejs files 2025-05-09 11:06:13 -07:00
knighthawk4227 f3b121fc71 Merge branch 'feature/forgotPass' into dev 2025-05-09 11:03:02 -07:00
knighthawk4227 07824e6355 merge cnflicts with dev 2025-05-09 11:02:31 -07:00
Joaquin 22850ab2a2 fix/removed redundant code and fixed UI challenge 1 problem 2025-05-09 10:55:02 -07:00
SowinskiBraeden 69fd776c0f fix/enhanced user input validation 2025-05-09 10:29:20 -07:00
knighthawk4227 671b67be9d Merge branch 'dev' into feature/forgotPass 2025-05-09 10:27:33 -07:00
knighthawk4227 99b36d3370 fixing conflict with dashboard.ejs 2025-05-09 10:26:18 -07:00
SowinskiBraeden 1f742d41c3 fix/signup using existing email 2025-05-09 10:23:34 -07:00
SowinskiBraeden 18bee21941 Merge branch 'dev' of github.com:JoaquinPar/2800-202510-BBY14 into dev 2025-05-09 10:07:16 -07:00
knighthawk4227 1fcd12c6da fixing merge conflicts 2025-05-09 10:04:24 -07:00
SowinskiBraeden 0a9c176274 fix/default asset icon creation 2025-05-09 10:00:51 -07:00
knighthawk4227 1587f363f7 fixing reset link session 2025-05-09 09:50:38 -07:00
SowinskiBraeden 540e191d27 refactor/remove debug statements 2025-05-09 09:49:14 -07:00
SowinskiBraeden 1e01e022bf Merge pull request #14 from JoaquinPar/feature/asset-select-icon
update+fix/asset icons + load geolocation scripts
2025-05-08 23:32:40 -07:00
knighthawk4227 c64da1de46 fixing conflicts and merging dev 2025-05-08 10:44:38 -07:00
knighthawk4227 7a5d2e7490 fixing conflicts merging dev into this 2025-05-08 10:40:31 -07:00
knighthawk4227 fc39bcf693 nodemailer dependencies 2025-05-08 10:32:10 -07:00
knighthawk4227 29d682c4e8 fixing joi validation 2025-05-07 19:26:00 -07:00
knighthawk4227 15dd4e0d20 forgot password validatation using joi 2025-05-07 19:09:25 -07:00
knighthawk4227 cb59e86d8a fixing merge conflicts and forgot password functionality 2025-05-07 17:44:06 -07:00
knighthawk4227 088f9ea55a reset pass logic 2025-05-07 13:03:26 -07:00
knighthawk4227 617fc8d877 indentation of dashboard 2025-05-07 10:49:08 -07:00
knighthawk4227 f0b1089e15 routes for forgotPass 2025-05-07 00:52:01 -07:00
knighthawk4227 a40b6d514b forgot password js 2025-05-06 23:33:05 -07:00
18 changed files with 438 additions and 169 deletions

No files matched your search

+3
View File
@@ -1,6 +1,9 @@
# Environment variables
.env
#vscode files
.vscode
# Node modules
node_modules/
+86 -3
View File
@@ -3,6 +3,7 @@ const MongoStore = require("connect-mongo");
const session = require("express-session");
const express = require('express');
const path = require('path');
const bcrypt = require('bcrypt');
const joi = require('joi');
require('dotenv').config();
@@ -11,7 +12,7 @@ const port = process.env.PORT || 3000;
const mongoURI = process.env.MONGO_URI;
const database = process.env.DATABASE; // Database name
const secret = process.env.SECRET || "123-secret-xyz";
const secret = process.env.SECRET || "123-secret-xyz";
/*** Sessions ***/
app.use(session({
@@ -39,9 +40,9 @@ async function initDatabase() {
const db = await connectMongo(mongoURI, database);
// For any collection, init here
users = await getCollection(db, "users");
users = await getCollection(db, "users");
assets = await getCollection(db, "assets");
plans = await getCollection(db, "plans");
plans = await getCollection(db, "plans");
}
/*** ROUTINGS ***/
@@ -73,6 +74,86 @@ app.get('/aboutUs', (req, res) => {
return res.status(status.Ok);
});
app.get('/forgotPassword', (req, res) => {
const error = req.session.error;
const reset = req.session.reset;
delete req.session.reset;
delete req.session.error;
res.render('forgotPass', { error: error, reset: reset });
return res.status(status.Ok);
});
// Reset with token given to user via email
app.get('/reset/:token', async (req, res) => {
const token = req.params.token;
const user = await users.findOne({
resetToken: token,
resetTokenExpires: { $gt: Date.now() },
});
if (!user) {
req.session.error = 'reset link not valid or has expired';
return res.redirect('/forgotPassword');
}
const error = req.session.error;
delete req.session.error;
res.render('resetPass', {
token: token,
errMessage: error,
});
});
app.post('/resetLink', async (req, res) => {
const { token, password, confirmPassword, } = req.body;
const passwordSchema = joi.object({
password: joi.string().max(20).required(),
confirmPassword: joi.string().max(20).required(),
});
const valid = passwordSchema.validate({ password, confirmPassword });
if (valid.error) {
console.log("houston we have a problem");
req.session.error = 'Invalid input';
res.status(status.BadRequest);
return res.redirect(`/reset/${token}`);
}
if (!token || !password || !confirmPassword) {
req.session.error = 'field may be missing';
return res.redirect(`/reset/${token}`);
}
if (password !== confirmPassword) {
req.session.error = 'passwords do not match';
return res.redirect(`/reset/${token}`);
}
const user = await users.findOne({
resetToken: token,
resetTokenExpires: { $gt: Date.now() },
});
if (!user) {
req.session.error = 'Reset link is invalid.';
return res.redirect(`/reset`);
}
const hashPassword = await bcrypt.hash(password, 12);
await users.updateOne(
{
email: user.email
},
{
$set: {
password: hashPassword,
resetToken: '',
resetTokenExpires: 0,
},
}
);
req.session.success = 'Password has been reset';
res.redirect('/login');
});
// 404 handler - keep the actual notFound route please
// REALLY DONT DELETE THIS
app.get('/notFound', (req, res) => {
@@ -86,6 +167,8 @@ initDatabase().then(() => {
// Import authentication handler
app.use(require("./src/auth/authentication")(users));
app.use(require('./src/auth/forgotPass')(users));
// Import middleware & apply to user routes
const middleware = require("./src/auth/middleware")(users);
+18 -1
View File
@@ -11,12 +11,14 @@
"dependencies": {
"bcrypt": "^5.1.1",
"connect-mongo": "^5.1.0",
"crypto": "^1.0.1",
"dotenv": "^16.5.0",
"ejs": "^3.1.10",
"express": "^5.1.0",
"express-session": "^1.18.1",
"joi": "^17.13.3",
"mongodb": "^6.16.0"
"mongodb": "^6.16.0",
"nodemailer": "^7.0.3"
},
"devDependencies": {
"nodemon": "^3.1.10"
@@ -483,6 +485,12 @@
"node": ">=6.6.0"
}
},
"node_modules/crypto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
"deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in."
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
@@ -1430,6 +1438,15 @@
"webidl-conversions": "^3.0.0"
}
},
"node_modules/nodemailer": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.3.tgz",
"integrity": "sha512-Ajq6Sz1x7cIK3pN6KesGTah+1gnwMnx5gKl3piQlQQE/PwyJ4Mbc8is2psWYxK3RJTVeqsDaCv8ZzXLCDHMTZw==",
"license": "MIT-0",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/nodemon": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz",
+3 -1
View File
@@ -20,12 +20,14 @@
"dependencies": {
"bcrypt": "^5.1.1",
"connect-mongo": "^5.1.0",
"crypto": "^1.0.1",
"dotenv": "^16.5.0",
"ejs": "^3.1.10",
"express": "^5.1.0",
"express-session": "^1.18.1",
"joi": "^17.13.3",
"mongodb": "^6.16.0"
"mongodb": "^6.16.0",
"nodemailer": "^7.0.3"
},
"devDependencies": {
"nodemon": "^3.1.10"
+12 -5
View File
@@ -20,7 +20,7 @@ module.exports = (users) => {
const credentialSchema = joi.object({
email: joi.string().email().required(),
password: joi.string().max(20).required(),
password: joi.string().alphanum().max(20).required(),
});
const valid = credentialSchema.validate(req.body);
@@ -56,9 +56,9 @@ module.exports = (users) => {
router.post("/signup", async (req, res) => {
const userSchema = joi.object({
email: joi.string().email().required(),
name: joi.string().alphanum().max(20).required(),
password: joi.string().max(20).min(8).required(),
repassword: joi.string().max(20).min(8).required(),
name: joi.string().pattern(new RegExp('^[a-zA-Z]+$')).max(20).required(),
password: joi.string().alphanum().max(20).min(8).required(),
repassword: joi.string().alphanum().max(20).min(8).required(),
});
const valid = userSchema.validate(req.body);
@@ -69,6 +69,13 @@ module.exports = (users) => {
return res.redirect("/signup");
}
let exists = await users.findOne({ email: req.body.email }).then((exists) => exists);
if (exists) {
req.session.errMessage = "Email already in use";
res.status(status.BadRequest);
return res.redirect("/signup");
}
if (req.body.password != req.body.repassword) {
req.session.errMessage = "Passwords must match";
res.status(status.BadRequest);
@@ -84,7 +91,7 @@ module.exports = (users) => {
financialData: false,
}).then((results, err) => {
if (err) {
console.error(err);
console.error("Error creating user on signup: ", err);
res.session.errMessage = "Internal server error";
return res.status(status.InternalServerError).redirect("/signup");
}
+68
View File
@@ -0,0 +1,68 @@
const express = require('express');
const crypto = require('crypto');
const joi = require('joi');
const nodeMail = require('nodemailer');
require('dotenv').config();
const transporter = nodeMail.createTransport({
service: 'gmail',
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASS,
}
});
// users info
module.exports = (users) => {
const router = express.Router();
router.post('/auth/resetPass', async (req, res) => {
console.log("we are inside of the post");
const resetSchema = joi.object({
email: joi.string().email().required(),
});
req.session.error = '';
req.session.reset = '';
const valid = resetSchema.validate(req.body);
if (valid.error) {
req.session.error = 'invalid email';
return res.redirect('/forgotPassword')
}
const { email } = req.body;
const user = await users.findOne({ email });
if (!user) {
req.session.error = 'No user found'
return res.redirect('/forgotPassword');
}
const token = crypto.randomBytes(32).toString('hex');
console.log(`The reset token is ${token}`)
const expiration = Date.now() + 360000;
await users.updateOne({ email }, {
$set: { resetToken: token, resetTokenExpires: expiration }
});
const resetUrl = `http://localhost:3000/reset/${token}`;
const mailSend = {
from: process.env.EMAIL_USER,
to: email,
subject: 'Password reset',
text: `reset your password here ${resetUrl} this link will expire within 1 hour`,
};
try {
await transporter.sendMail(mailSend);
req.session.reset = 'Reset link sent Check your email';
res.redirect('/forgotPassword');
} catch (err) {
console.log('there was an error', err);
res.status(500).send('email failed to send try again');
}
});
return router;
}
-2
View File
@@ -37,8 +37,6 @@ function update(data) {
dropdown.appendChild(listItem);
});
// console.log(data);
}
function switchButton(clickedButton) {
+12 -17
View File
@@ -98,9 +98,7 @@ module.exports = (middleware, users, plans, assets) => {
router.get('/plans', async (req, res) => {
try {
// console.log(new ObjectId(req.session.user._id));
const userPlansFromDB = await plans.find({userId: new ObjectId(req.session.user._id) }).toArray();
// console.log(userPlansFromDB);
const userPlansFromDB = await plans.find({ userId: new ObjectId(req.session.user._id) }).toArray();
// Use a for...of loop for proper async/await behavior in series for updates
for (const plan of userPlansFromDB) {
@@ -142,7 +140,6 @@ module.exports = (middleware, users, plans, assets) => {
req.session.errMessage = "Plan not found or you do not have permission to view it.";
return res.status(status.NotFound).redirect('/plans');
}
// console.log("Found plan:", plan);
// The plan.progress should be up-to-date from the database as it was updated in the /plans route
// or when assets/plans are modified. If an immediate recalculation for this specific view is absolutely needed,
@@ -166,7 +163,7 @@ module.exports = (middleware, users, plans, assets) => {
});
router.get('/newPlan', (req, res) => {
if(!req.session.user.financialData){
if (!req.session.user.financialData) {
req.session.errMessage = "Please complete your financial data before creating a plan.";
return res.status(status.Unauthorized).redirect('/questionnaire');
}
@@ -207,12 +204,12 @@ module.exports = (middleware, users, plans, assets) => {
progress: "0"
};
try{
await plans.insertOne({userId: new ObjectId(req.session.user._id), ...newPlan});
try {
await plans.insertOne({ userId: new ObjectId(req.session.user._id), ...newPlan });
req.session.errMessage = "";
res.redirect('/plans');
}
catch(err){
catch (err) {
console.error("Error saving plan:", err);
req.session.errMessage = "An error occurred while saving your plan. Please try again.";
res.status(status.InternalServerError).redirect("/newPlan");
@@ -255,8 +252,6 @@ module.exports = (middleware, users, plans, assets) => {
});
router.post('/questionnaire', (req, res) => {
// console.log("Questionnaire POST body:", req.body);
const questionnaireSchema = joi.object({
dob: joi.date().required(),
education: joi.string().valid('primary', 'secondary', 'tertiary', 'postgraduate').required(),
@@ -316,16 +311,16 @@ module.exports = (middleware, users, plans, assets) => {
router.post("/updateAccount", async (req, res) => {
const accountSchema = joi.object({
email: joi.string().email(),
name: joi.string().alphanum().max(20),
password: joi.string().max(20).min(8),
repassword: joi.string().max(20).min(8),
name: joi.string().pattern(new RegExp('^[a-zA-Z]+$')).max(20),
password: joi.string().alphanum().max(20).min(8),
repassword: joi.string().alphanum().max(20).min(8),
});
const valid = accountSchema.validate(req.body);
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/profile");
}
@@ -380,7 +375,7 @@ module.exports = (middleware, users, plans, assets) => {
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/assets");
}
@@ -425,13 +420,13 @@ module.exports = (middleware, users, plans, assets) => {
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/assets");
}
if (req.body.userId != req.session.user._id) {
req.session.errMessage = "Cannot change asset owner",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/assets");
}
+1 -1
View File
@@ -38,7 +38,7 @@
<!-- Create other asset form -->
<form method="POST" action="/createAsset" id="create-other-asset-form">
<input style="display: none;" id="type" value="other" name="type" type="text">
<input style="display: none;" id="icon" value="other" name="icon" type="text">
<input style="display: none;" id="icon" value="Other" name="icon" type="text">
<label for="name" class="block text-sm font-medium text-gray-700 mt-2">Select an Icon</label>
<div class="flex items-center">
+112 -91
View File
@@ -1,95 +1,116 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<%- include("./partials/header") %>
<main>
<!-- Buttons -->
<div class="flex justify-end gap-4 px-5 py-6">
<a href="/assets?popup" class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800" type="button">Add Asset</a>
<a href="/newPlan" class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800" type="button">Create new plan </a>
</div>
<!--This is the cards for plans and other things-->
<div class="mt-12">
<div class="mb-12 grid gap-y-10 gap-x-6 md:grid-cols-2 mr-3 ml-3 xl:grid-cols-4">
<!--box to put logo icon if we want on in a box-->
<div class=" relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-blue-600 to-blue-400 text-white shadow-blue-500/40 shadow-lg absolute mt-2 grid h-16 w-16 place-items-center"> -->
<!-- </div> -->
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
<main>
<!-- Buttons -->
<div class="flex justify-end gap-4 px-5 py-6">
<a href="/assets?popup"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Add Asset</a>
<a href="/newPlan"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Create new plan </a>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or graph or something </strong>&nbsp;than lastweek
</p>
</div>
</div>
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or graph or something </strong>&nbsp;than last
week
</p>
</div>
</div>
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-green-600 to-green-400 text-white shadow-green-500/40 shadow-lg absolute -mt-4 grid h-16 w-16 place-items-center"> -->
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" -->
<!-- class="w-6 h-6 text-white"> -->
<!-- <path -->
<!-- d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5 0v2.25H16a.75.75 0 000 1.5h2.25v2.25a.75.75 0 001.5 0v-2.25H22a.75.75 0 000-1.5h-2.25V7.5z"> -->
<!-- </path> -->
<!-- </svg> -->
<!-- </div> -->
<!-- we can use this later if needed not sure what it shoudl be for right now. -->
<!-- <div class="p-4 text-right"> -->
<!-- <p class="block antialiased font-sans text-sm leading-normal font-normal text-blue-gray-600">New Clients -->
<!-- </p> -->
<!-- <h4 -->
<!-- class="block antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900"> -->
<!-- 3,462</h4> -->
<!-- </div> -->
<!-- <div class="border-t border-blue-gray-50 p-4"> -->
<!-- <p class="block antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600"> -->
<!-- <strong class="text-red-500">-2%</strong>&nbsp;than yesterday -->
<!-- </p> -->
<!-- </div> -->
<!-- </div> -->
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or graph or something </strong>&nbsp;than last
week
</p>
</div>
</div>
</div>
</div>
</div>
<div class="text-blue-gray-600">
</div>
</main>
<!--This is the cards for plans and other things-->
<div class="mt-12">
<!--box to put logo icon if we want on in a box-->
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-blue-600 to-blue-400 text-white shadow-blue-500/40 shadow-lg absolute mt-2 grid h-16 w-16 place-items-center"> -->
<!-- </div> -->
<!--This is the cards for plans and other things-->
<div class="mt-12">
<div class="mb-12 grid gap-y-10 gap-x-6 md:grid-cols-2 mr-3 ml-3 xl:grid-cols-4">
<!--box to put logo icon if we want on in a box-->
<div class=" relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-blue-600 to-blue-400 text-white shadow-blue-500/40 shadow-lg absolute mt-2 grid h-16 w-16 place-items-center"> -->
<!-- </div> -->
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p
class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or graph or
something
</strong>&nbsp;than lastweek
</p>
</div>
</div>
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p
class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or graph or
something
</strong>&nbsp;than last
week
</p>
</div>
</div>
<div class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-green-600 to-green-400 text-white shadow-green-500/40 shadow-lg absolute -mt-4 grid h-16 w-16 place-items-center"> -->
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" -->
<!-- class="w-6 h-6 text-white"> -->
<!-- <path -->
<!-- d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5 0v2.25H16a.75.75 0 000 1.5h2.25v2.25a.75.75 0 001.5 0v-2.25H22a.75.75 0 000-1.5h-2.25V7.5z"> -->
<!-- </path> -->
<!-- </svg> -->
<!-- </div> -->
<!-- we can use this later if needed not sure what it shoudl be for right now. -->
<!-- <div class="p-4 text-right"> -->
<!-- <p class="block antialiased font-sans text-sm leading-normal font-normal text-blue-gray-600">New Clients -->
<!-- </p> -->
<!-- <h4 -->
<!-- class="block antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900"> -->
<!-- 3,462</h4> -->
<!-- </div> -->
<!-- <div class="border-t border-blue-gray-50 p-4"> -->
<!-- <p class="block antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600"> -->
<!-- <strong class="text-red-500">-2%</strong>&nbsp;than yesterday -->
<!-- </p> -->
<!-- </div> -->
<!-- </div> -->
<div
class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div
class="relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md">
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-normal text-blue-gray-600">
Retirement goal</p>
<h4
class="block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
$53k</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p
class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<strong class="text-green-500">Make this percent bar or
graph or something
</strong>&nbsp;than last
week
</p>
</div>
</div>
</div>
</div>
</div>
<div class="text-blue-gray-600">
</div>
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
+38
View File
@@ -0,0 +1,38 @@
<%- include("./partials/fileHeader") %>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/auth/resetPass" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold">Reset Password</h1>
<hr class="mt-3">
<% if (!reset ) { %>
<div class="mt-3">
<label for="email" class="block text-base mb-2">Email</label>
<input type="text" id="email" name="email"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<% } else { %>
<div class="mt-3">
<h1 class="text-2xl block text-center font-bold text-red-600"> Reset link sent. </h1>
</div>
<% } %>
<!---->
<div class="text-red-800 font-bold" id="forgor">
<%= error%>
</div>
<% if (!reset) { %>
<div class="mt-5">
<button type="submit"
class="cursor-pointer border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Send
reset Link</button>
</div>
<% } %>
</div>
</form>
</div>
</main>
<%- include("./partials/footer") %> <%- include("./partials/footer") %>
+1 -1
View File
@@ -25,7 +25,7 @@
<label>Remember me</label>
</div>
<div>
<a href="#" class="text-indigo-600 font-semibold">Forgot Password? </a>
<a href="/forgotPassword" class="text-indigo-600 font-semibold">Forgot Password? </a>
</div>
</div>
<div class="mt-5">
+2
View File
@@ -7,5 +7,7 @@
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/flowbite@3.1.2/dist/flowbite.min.js"></script>
</body>
</html>
+2 -2
View File
@@ -22,7 +22,7 @@
<p id="flagTag"></p>
</div>
<div class="relative w-full">
<p id="exchange" class="block text-center p-2.5 w-30 z-20 text-sm text-gray-900 bg-gray-50 border-s-0 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500">
<p id="exchange" class="block text-center p-2.5 w-40 z-20 text-sm text-gray-900 bg-gray-50 border-s-0 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500">
</p>
</div>
<button id="dropdown-country-button" value="" data-dropdown-toggle="dropdown-country" class="shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-e-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600" type="button">
@@ -45,7 +45,7 @@
<p id="flagTag"></p>
</div>
<div class="relative w-full">
<p id="exchange" class="block text-center p-2.5 w-30 z-20 text-sm text-gray-900 bg-gray-50 border-s-0 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500">
<p id="exchange" class="block text-center p-2.5 w-40 z-20 text-sm text-gray-900 bg-gray-50 border-s-0 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500">
$1.00 = $<%= (1 * geoData.toCurrencyRates["USD"]).toFixed(2) %>
</p>
</div>
-1
View File
@@ -1,5 +1,4 @@
<!-- Get geolocation if not in session and load conversion rates -->
<script src="https://cdn.jsdelivr.net/npm/flowbite@3.1.2/dist/flowbite.min.js"></script>
<script src="/static/scripts/geolocation.js"></script>
<script>
// If no geoData provided thorugh EJS, send update request to backend
+1 -1
View File
@@ -56,7 +56,7 @@
<form action="/updateAccount" method="post" class="space-y-4 mt-4" id="account-form">
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<input id="email" disabled type="text" name="email" value="<%= user.email %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<input id="email" disabled type="email" name="email" value="<%= user.email %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<label for="name" class="block text-sm font-medium text-gray-700">Name</label>
<input id="name" disabled type="text" name="name" value="<%= user.name %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
+36
View File
@@ -0,0 +1,36 @@
<%- include("./partials/fileHeader") %>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/resetLink" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold">Reset Password</h1>
<hr class="mt-3">
<input type="hidden" name="token" value="<%=token %>">
<div class="mt-3">
<label for="password" class="block text-base mb-2">New Password:</label>
<input type="text" id="password" name="password"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Confirm Password:</label>
<input type="text" id="Repassword" name="confirmPassword"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="ReType Password" />
</div>
<% if (typeof errMessage !=='undefined' ) { %>
<div class="text-red-800 font-bold" id="forgor">
<%= errMessage %>
</div>
<% } %>
<div class="mt-5">
<button type="submit"
class="cursor-pointer border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Change
Password</button>
</div>
</div>
</form>
</div>
</main>
<%- include("./partials/footer") %>
+43 -43
View File
@@ -1,46 +1,46 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<%- include("./partials/headerStart") %>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/signup" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold">Signup</h1>
<hr class="mt-3">
<div class="mt-3">
<label for="name" class="block text-base mb-2">Name</label>
<input type="text" id="name" name="name"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Name" />
</div>
<div class="mt-3">
<label for="email" class="block text-base mb-2">Email</label>
<input type="text" id="email" name="email"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Password</label>
<input type="password" id="password" name="password"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
<label for="password" class="block text-base mb-2 mt-3">Re-type Password</label>
<input type="password" id="repassword" name="repassword"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
</div>
<div class="text-red-800 font-bold " id="forgor"> <%= errMessage %></div>
<div class="mt-5">
<button type="submit"
class="border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Signup</button>
</div>
<div class="mt-5 block justify-between items-center">
<label>Already have an account?</label>
<a href="/login" class="text-indigo-600 font-semibold">Login</a>
</div>
</div>
</form>
</div>
</main>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/signup" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold">Signup</h1>
<hr class="mt-3">
<div class="mt-3">
<label for="name" class="block text-base mb-2">Name</label>
<input type="text" id="name" name="name"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Name" />
</div>
<div class="mt-3">
<label for="email" class="block text-base mb-2">Email</label>
<input type="email" id="email" name="email"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Password</label>
<input type="password" id="password" name="password"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
<label for="password" class="block text-base mb-2 mt-3">Re-type Password</label>
<input type="password" id="repassword" name="repassword"
class="border focus:border-gray-600 w-full rounded-md text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
</div>
<div class="text-red-800 font-bold " id="forgor">
<%= errMessage %>
</div>
<div class="mt-5">
<button type="submit"
class="border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Signup</button>
</div>
<div class="mt-5 block justify-between items-center">
<label>Already have an account?</label>
<a href="/login" class="text-indigo-600 font-semibold">Login</a>
</div>
</div>
</main>
<%- include("./partials/footer") %>
<%- include("./partials/footer") %>