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

reusing existing key instead of creating a new one

parent 735b6388
No related branches found
No related tags found
No related merge requests found
Pipeline #7544 passed
...@@ -13,6 +13,9 @@ var checkout_router_cash = require("./checkout/cash"); ...@@ -13,6 +13,9 @@ var checkout_router_cash = require("./checkout/cash");
var Key = require("../app/Key"); var Key = require("../app/Key");
router.get("/create", function (req, res, next) { router.get("/create", function (req, res, next) {
if (req.cookies.key) {
return res.redirect(`${res.locals.baseDir}/key/enter`);
}
Key.GET_NEW_KEY().then((key) => { Key.GET_NEW_KEY().then((key) => {
res.redirect(`${res.locals.baseDir}/key/` + key.get_key() + "?new=true"); res.redirect(`${res.locals.baseDir}/key/` + key.get_key() + "?new=true");
}); });
......
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