import { Component } from '../../lib/vues6/vues6.js' import { session } from '../service/Session.service.js' import { location_service } from '../service/Location.service.js' import { auth_api } from '../service/AuthApi.service.js' const template = `
{{ app_name }}
{{ error_message }}
{{ other_message }}
` export default class MFADisableComponent extends Component { static get selector() { return 'coreid-mfa-disable-page' } static get template() { return template } static get props() { return [] } constructor() { super() this.app_name = '' this.step = 0 this.loading = false this.error_message = '' this.other_message = '' this.t = {} } async vue_on_create() { this.app_name = session.get('app.name') this.t = await T( 'common.cancel', 'common.unknown_error', 'mfa.disable_success', 'mfa.disable', 'mfa.disable_prompt' ) } async back_click() { this.loading = true await location_service.redirect('/dash/profile', 500) } async continue_click() { this.loading = true const success = await auth_api.mfa_disable() if ( success ) { this.other_message = this.t['mfa.disable_success'] await location_service.redirect('/dash/profile', 3000) } else { this.error_message = this.t['common.unknown_error'] await location_service.reload(4000) } } }