landing page done

This commit is contained in:
BIG2EYEZ
2024-01-25 16:33:56 +08:00
parent 92b0f86be6
commit 39f7ad3c73
30 changed files with 8644 additions and 6 deletions

View File

@ -44,9 +44,12 @@ function isAuthenticated(req, res, next) {
if (req.session && req.session.authenticated) {
return next();
} else {
res.redirect("/login");
res.redirect("/index");
}
}
app.get('/index', (req, res) => {
res.render('index');
});
app.get("/login", (req, res) => {
res.render("login", { error: null });
@ -203,11 +206,8 @@ app.post("/verify-otp", otpValidation ,async (req, res) => {
});
app.get("/home", isAuthenticated, async (req, res) => {
const response = await axios.get(process.env.API_ALLLOCATION);
const valueData = response.data;
console.log = (valueData);
res.render("home", { username: req.session.username, valueData});
res.render("home", { username: req.session.username});
});
app.get("/inusers", isAuthenticated, async (req, res) => {