diff --git a/controllers/session_controller.js b/controllers/session_controller.js index e2c7491..fad6684 100644 --- a/controllers/session_controller.js +++ b/controllers/session_controller.js @@ -9,7 +9,7 @@ router.get("/", (req, res) => { router.get("/login", (req, res) => { const unsuccessfulString = "" - res.render("login", { unsuccessfulString }) + res.render("login", { message: req.flash('info') }) }) router.post("/sessions", (req, res) => { @@ -20,8 +20,8 @@ router.post("/sessions", (req, res) => { const sql = `SELECT * FROM users WHERE email = '${email}'` db.query(sql, (err, dbRes) => { if (dbRes.rows.length === 0) { // if no user exists - const unsuccessfulString = "Account does not exist with this email" - res.render("login", { unsuccessfulString }) + req.flash("info", "Account does not exist with this email") + res.redirect("/login") return } const user = dbRes.rows[0] @@ -32,8 +32,8 @@ router.post("/sessions", (req, res) => { console.log(req.session); res.redirect(`/users/${user.user_id}`) } else { - const unsuccessfulString = "Incorrect password, please try again" - res.render("login", { unsuccessfulString }) + req.flash("info", "Incorrect password, please try again") + res.redirect("/login") } }); }) diff --git a/public/css/home.css b/public/css/home.css index ea724bc..3ba4faa 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -50,10 +50,12 @@ p { .already_member a { color: #fff; + font-size: 20px; } .already_member span { color: #9500ff; + font-family: 'Bebas Neue', cursive; } #features ul { diff --git a/public/css/style.css b/public/css/style.css index 606dbf4..c446dc2 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,6 +1,6 @@ * { box-sizing: border-box; - font-family: Arial, Helvetica, sans-serif; + font-family: 'Abel', sans-serif; margin: 0; } diff --git a/views/layout.ejs b/views/layout.ejs index 8939369..34573a3 100644 --- a/views/layout.ejs +++ b/views/layout.ejs @@ -6,9 +6,12 @@
My Workouts