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 }}
This process will disable multi-factor authentication on your account.

For security reasons, this will sign you out of all devices. It will also deactivate any existing app passwords you have generated.

Are you sure you want to continue?
{{ 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 [] } app_name = '' step = 0 loading = false error_message = '' other_message = '' vue_on_create() { this.app_name = session.get('app.name') console.log({session}) } 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 = 'MFA was successfully disabled. You\'ll now sign-in normally.' await location_service.redirect('/dash/profile', 3000) } else { this.error_message = 'An unknown error occurred while trying to disable MFA. Let\'s try again...' await location_service.reload(4000) } } }