Skip to content
Snippets Groups Projects
Commit 44473ec9 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

loading key from referer if possible

parent 2af80380
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,8 @@ services: ...@@ -29,6 +29,8 @@ services:
ports: ports:
- 8085:3000 - 8085:3000
- 9229:9229 - 9229:9229
ulimits:
nofile: 65535
depends_on: depends_on:
- express_postgres - express_postgres
express_cron: express_cron:
......
...@@ -75,7 +75,18 @@ router.get("/enter", function (req, res, next) { ...@@ -75,7 +75,18 @@ router.get("/enter", function (req, res, next) {
); );
}); });
} else { } else {
res.render("login/key"); // If the user is using a URL Parameter on MetaGer to use his key there might be a key in the referer
let matches = req.header("referer").match(/\?.*key=([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/);
if (matches) {
let key_from_referer = matches[1];
Key.GET_KEY(key_from_referer, false).then((key) => {
res.redirect(
`${res.locals.baseDir}/key/` + encodeURIComponent(key.get_key())
);
});
} else {
res.render("login/key");
}
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment