@foal/jwt
Version:
Authentication with JWT for FoalTS
10 lines (9 loc) • 426 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldVerifyCsrfToken = shouldVerifyCsrfToken;
const core_1 = require("@foal/core");
function shouldVerifyCsrfToken(request, options) {
return (options.cookie === true &&
(options.csrf ?? core_1.Config.get('settings.jwt.csrf.enabled', 'boolean', false)) &&
['DELETE', 'PATCH', 'POST', 'PUT'].includes(request.method));
}