@pubby/sdk
Version:
Pubby Development Kit
40 lines (35 loc) • 1.22 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var tslib = require('tslib');
var module$1 = require('../../module.js');
var AuthModule = /** @class */ (function (_super) {
tslib.__extends(AuthModule, _super);
function AuthModule(pubby, options) {
var _this = _super.call(this, pubby, options) || this;
pubby.auth = _this;
return _this;
}
Object.defineProperty(AuthModule.prototype, "user", {
get: function () {
return this.strategy.user;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AuthModule.prototype, "strategy", {
get: function () {
return this.options.strategy;
},
enumerable: false,
configurable: true
});
AuthModule.prototype.init = function () {
var _a, _b;
return (_b = (_a = this.strategy).init) === null || _b === void 0 ? void 0 : _b.call(_a, this.pubby);
};
AuthModule.prototype.isAuthenticated = function () {
return this.strategy.isAuthenticated();
};
return AuthModule;
}(module$1.PubbyModule));
exports.AuthModule = AuthModule;