Some changes
This commit is contained in:
parent
99d2507248
commit
a35c8899ac
27 changed files with 200 additions and 48 deletions
|
@ -11,11 +11,18 @@ import render from "../libs/format";
|
|||
// eslint-disable-next-line new-cap
|
||||
const router = express.Router();
|
||||
|
||||
router
|
||||
.route("/")
|
||||
.get(ensureLoggedIn("/connexion"), (req, res) =>
|
||||
res.redirect("/ma-collection")
|
||||
);
|
||||
router.route("/").get((req, res, next) => {
|
||||
if (req.user) {
|
||||
return res.redirect("/ma-collection");
|
||||
}
|
||||
try {
|
||||
const page = new Pages(req, "home");
|
||||
|
||||
return render(res, page);
|
||||
} catch (err) {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
|
||||
router
|
||||
.route("/connexion")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue