Skip to content

Commit

Permalink
fix: correctly set location header
Browse files Browse the repository at this point in the history
  • Loading branch information
Esinko committed Dec 18, 2022
1 parent bd54ea2 commit 55cd2d7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/routes/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ router.get("/", cookieParser(), async (req, res) => {
const session = await database.UserInfo.getWithSessionCode(req.cookies?.code)
if (!session || !session.membersPageSession || !session.membersPageSession.timestamp) return res.status(400).send("Permission denied.")
if (session.membersPageSession.timestamp + sessionExpiry < new Date().getTime()) {
return res.status(307, {
Location: "testausserveri.fi?relog=1"
}).end()
return res.status(307).setHeader("Location", "testausserveri.fi?relog=1").end()
}

// Session is valid
Expand Down

0 comments on commit 55cd2d7

Please sign in to comment.