Redirect to home if not signed in

This commit is contained in:
Rogerio Chaves 2020-04-17 19:46:22 +02:00
parent abb5c564cf
commit 54a66a9e3f
No known key found for this signature in database
GPG Key ID: E6AF5440509B1D94
1 changed files with 12 additions and 0 deletions

View File

@ -264,6 +264,10 @@ router.get("/keys/download", async (req, res) => {
});
router.get("/profile/:id(*)", async (req, res) => {
if (!req.context.profile) {
return res.render("index");
}
const id = req.params.id;
if (id == req.context.profile.id) {
@ -394,6 +398,10 @@ router.post("/pubs/add", async (req, res) => {
});
router.get("/about", (_req, res) => {
if (!req.context.profile) {
return res.render("index");
}
res.render("about");
});
@ -446,6 +454,10 @@ router.get("/debug-error", (_req, res) => {
});
router.get("/search", async (req, res) => {
if (!req.context.profile) {
return res.render("index");
}
const query = req.query.query;
const people = await queries.searchPeople(ssbServer, query);