Skip to content

Commit

Permalink
Late night mistake (forgot about a feature)
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 15, 2021
1 parent 6eb6c19 commit 50d41df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
18 changes: 11 additions & 7 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ function auth (obj, config) {
passportInit, passportSession;

function csrfWrapper (req, res, next) {
luscaCsrf(req, res, err => {
const key = req.server.config.security.key;
if (req.unprotect) {
next();
} else {
luscaCsrf(req, res, err => {
const key = req.server.config.security.key;

if (err === void 0 && req.csrf && key in res.locals) {
res.header(req.server.config.security.key, res.locals[key]);
}
if (err === void 0 && req.csrf && key in res.locals) {
res.header(req.server.config.security.key, res.locals[key]);
}

next(err);
});
next(err);
});
}
}

function redirect (req, res) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tenso is an HTTP REST API framework",
"version": "16.2.3",
"version": "16.2.4",
"homepage": "https://github.com/avoidwork/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 50d41df

Please sign in to comment.