diff --git a/app.js b/app.js index 818f0e0..5ac521d 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ const meralcoRoutes = require("./config/Routes/meralcoRoutes"); const tenantRoutes = require("./config/Routes/tenantRoutes"); const migrationRoutes = require("./config/Routes/migrationRoutes"); -const port = process.env.PORT || 5432; +const port = process.env.PORT || 3000; const app = express(); app.use(express.static("public")); diff --git a/config/Routes/mainRoutes.js b/config/Routes/mainRoutes.js index 75b4629..67f03de 100644 --- a/config/Routes/mainRoutes.js +++ b/config/Routes/mainRoutes.js @@ -35,6 +35,7 @@ router.get('/dashboard', async (req, res) => { mainUserData = await User.query().findById(user.id); } else { // Redirect to login if user cannot be authenticated + req.flash('message', { text: 'wrong password', type: 'danger' }); return res.redirect('/'); } } else { @@ -116,7 +117,7 @@ router.post('/login', async (req, res) => { if (user) { const passwordMatch = await bcrypt.compare(password, user.password); - + console.log(`Password match: ${passwordMatch}`); if (passwordMatch) { req.session.user = user; if (remember_me) { diff --git a/knexfile.js b/knexfile.js index 6ac1d67..982301e 100644 --- a/knexfile.js +++ b/knexfile.js @@ -6,11 +6,11 @@ module.exports = { development: { client: 'mysql', connection: { - host: 'localhost', - user: 'root', - password: '', - database: 'am9commercial', - connectionLimit: 5, + host: 'b18rvltkeprxyrwdxj35-mysql.services.clever-cloud.com', + user: 'u1llarmjzoo3t683', + password: 'HKDuDLkfJO1cZQJX58M7', + database: 'b18rvltkeprxyrwdxj35', + connectionLimit: 20, }, pool: { min: 2, @@ -24,11 +24,11 @@ module.exports = { staging: { client: 'mysql', connection: { - host: 'dpg-cpi0prsf7o1s73ba9bi0-a', - user: 'root', - password: 'OBOW3zix2UcYdqt1U79cofZTBvuXHPoI', - database: 'am9commercial', - connectionLimit: 5, + host: 'b18rvltkeprxyrwdxj35-mysql.services.clever-cloud.com', + user: 'u1llarmjzoo3t683', + password: 'HKDuDLkfJO1cZQJX58M7', + database: 'b18rvltkeprxyrwdxj35', + connectionLimit: 20, }, pool: { min: 2, @@ -42,11 +42,11 @@ module.exports = { production: { client: 'mysql', connection: { - host: 'dpg-cpi0prsf7o1s73ba9bi0-a', - user: 'root', - password: 'OBOW3zix2UcYdqt1U79cofZTBvuXHPoI', - database: 'am9commercial', - connectionLimit: 5, + host: 'b18rvltkeprxyrwdxj35-mysql.services.clever-cloud.com', + user: 'u1llarmjzoo3t683', + password: 'HKDuDLkfJO1cZQJX58M7', + database: 'b18rvltkeprxyrwdxj35', + connectionLimit: 20, }, pool: { min: 2,