Skip to content

Commit

Permalink
actual persistent cookie fixes yay!
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon1320 committed Sep 10, 2018
1 parent eddcbce commit 885329b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ app.engine("ejs", ejs.renderFile);
app.use(express.static(path.join(__dirname, "static")));

app.use(express.json());
app.use(cookieParser());
app.use(cookieParser(config.rawrxd));

app.use(i18n({
translationsPath: path.join(__dirname, 'translations'),
Expand Down
2 changes: 1 addition & 1 deletion src/web/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ router.get("/auth/discord", async (req, res) => {
res.render("401", { status: 401, message: "Unauthorized", error });
}

res.cookie("session", jwt.sign({ id: new_session_doc._id }, config.jwt_secret), config.rawrxd, { maxAge: 60000, httpOnly: true, secure: true, signed: true });
res.cookie("session", jwt.sign({ id: new_session_doc._id }, config.jwt_secret), { maxAge: 604800000, httpOnly: true });
res.redirect(`https://discordapp.com/api/oauth2/authorize?client_id=${config.discord_id}&redirect_uri=${encodeURIComponent(config.discord_redirect)}&response_type=code&scope=guilds%20identify&state=${nonce}`);
});

Expand Down

0 comments on commit 885329b

Please sign in to comment.