@becomes/cms
Version:
Simple CMS for building APIs.
28 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityCodeBufferService = void 0;
var crypto = require("crypto");
var SecurityCodeBufferService = (function () {
function SecurityCodeBufferService() {
}
SecurityCodeBufferService.gen = function () {
this.securityCode = crypto.randomBytes(64).toString('base64');
console.log('>>>>>> Server secret for creating an Admin <<<<<');
console.log(this.securityCode);
};
SecurityCodeBufferService.compare = function (securityCode) {
if (this.securityCode === '') {
return false;
}
if (this.securityCode === securityCode) {
this.securityCode = '';
return true;
}
this.securityCode = '';
return false;
};
SecurityCodeBufferService.securityCode = '';
return SecurityCodeBufferService;
}());
exports.SecurityCodeBufferService = SecurityCodeBufferService;
//# sourceMappingURL=security-code-buffer.service.js.map