UNPKG

zents

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

21 lines 756 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CookieSecurityStrategy = void 0; const config_1 = require("../../config/config"); class CookieSecurityStrategy { get cookieKey() { var _a, _b; return (_b = (_a = config_1.config.security) === null || _a === void 0 ? void 0 : _a.cookieKey) !== null && _b !== void 0 ? _b : 'zenapp_jwt'; } hasToken(context) { return context.cookie.has(this.cookieKey); } getToken(context) { return context.cookie.get(this.cookieKey); } setToken(context, token) { context.cookie.set(this.cookieKey, token); } } exports.CookieSecurityStrategy = CookieSecurityStrategy; //# sourceMappingURL=CookieSecurityStrategy.js.map