UNPKG

@oxyhq/services

Version:

Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀

53 lines (51 loc) • 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OxyServicesTotpMixin = OxyServicesTotpMixin; /** * TOTP Enrollment Methods Mixin */ function OxyServicesTotpMixin(Base) { return class extends Base { constructor(...args) { super(...args); } async startTotpEnrollment(sessionId) { try { return await this.makeRequest('POST', '/api/auth/totp/enroll/start', { sessionId }, { cache: false }); } catch (error) { throw this.handleError(error); } } async verifyTotpEnrollment(sessionId, code) { try { return await this.makeRequest('POST', '/api/auth/totp/enroll/verify', { sessionId, code }, { cache: false }); } catch (error) { throw this.handleError(error); } } async disableTotp(sessionId, code) { try { return await this.makeRequest('POST', '/api/auth/totp/disable', { sessionId, code }, { cache: false }); } catch (error) { throw this.handleError(error); } } }; } //# sourceMappingURL=OxyServices.totp.js.map