lisa-box
Version:
Home automation system L.I.S.A.
20 lines • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("@fabrix/fabrix/dist/common");
class RegisterPolicy extends common_1.FabrixPolicy {
protect(req, res, next) {
this.app.orm.User.findAll().then(users => {
if (users && users.length > 0) {
res.status(403).end();
}
else {
next();
}
}).catch(err => {
this.log.error(err);
res.status(500).end();
});
}
}
exports.RegisterPolicy = RegisterPolicy;
//# sourceMappingURL=RegisterPolicy.js.map