chore: add comment for clarification

v1.18.x
Julian Lam 4 years ago
parent 13d5a1440b
commit 6037f5ee2c

@ -34,6 +34,7 @@ module.exports = function (middleware) {
const loginAsync = util.promisify(req.login).bind(req); const loginAsync = util.promisify(req.login).bind(req);
if (req.loggedIn) { if (req.loggedIn) {
// If authenticated via cookie (express-session), protect routes with CSRF checking
if (res.locals.isAPI) { if (res.locals.isAPI) {
await middleware.applyCSRFasync(req, res); await middleware.applyCSRFasync(req, res);
} }

Loading…
Cancel
Save