UNPKG

@pubby/sdk

Version:
36 lines (33 loc) 1.12 kB
import { __extends } from 'tslib'; import { PubbyModule } from '../../module.js'; var AuthModule = /** @class */ (function (_super) { __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; }(PubbyModule)); export { AuthModule };