HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/self/root/home/arjun/projects/buyercall/buyercall/assets/vue/widgets/ProfileSettings/2FA.vue
<template>
  <div class="row justify-content-center">
    <div class="col-xl-12">
      <div class="card two-factor-auth">
        <div class="card-body">
          <h4 class="card-title">Two Factor Authentication</h4>
          <p class="card-title-desc">
            Enhance your account security through two factor authentication.
            Send yourself verification codes everytime you login.
          </p>
          <b-form @submit.prevent="onFormSubmit">
            <div class="form-check form-switch mb-3 form-switch-lg">
              <input
                class="form-check-input"
                type="checkbox"
                id="twoFactor"
                v-model="form.twoFactor"
              />
              <label class="form-check-label" for="twoFactor"
                >Enable SMS Two Factor Authentication</label
              >
            </div>
            <p class="card-text mb-4">
              When enabled we will send you verification codes to your mobile
              number; {{ profileData.mobileNumber }}
            </p>
            <div>
              <b-button variant="primary" type="submit">
                <i
                  class="bx bx-loader bx-spin font-size-16 align-middle me-2"
                  v-if="updateProfile2FALoading"
                ></i>
                Save</b-button
              >
              <b-button variant="light" @click="onResetForm">Cancel</b-button>
            </div>
          </b-form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { BForm ,BButton} from 'bootstrap-vue-next'

export default {
  components: {
    BForm,
    BButton
  },
  data() {
    return {
      form: {
        twoFactor: this.twoFactor,
      },
    };
  },
  props: {
    twoFactor: {
      type: Boolean,
      required: true,
    },
    updateProfile2FALoading: {
      type: Boolean,
      required: true,
    },
    profileData: {
      type: Object,
      required: true,
    },
  },
  methods: {
    onFormSubmit() {
      this.$emit('formSubmit', this.form);
    },
    onResetForm() {
      this.form = {
        twoFactor: this.twoFactor,
      };
    },
  },
};
</script>