|
| 1 | +<script setup> |
| 2 | +import { useGeneralStore } from "../../../../stores/settings/store-general_setting"; |
| 3 | +
|
| 4 | +const store = useGeneralStore(); |
| 5 | +</script> |
| 6 | + |
| 7 | +<template> |
| 8 | + <div v-if="store && store.list"> |
| 9 | + <div class="grid"> |
| 10 | + <div class="col-12"> |
| 11 | + <h4 class="font-semibold text-sm">Multi-Factor Authentication</h4> |
| 12 | + <p class="text-color-secondary text-xs font-semibold">Require a email OTP, sms OTP or authenticator app verification when you login with password.</p> |
| 13 | + </div> |
| 14 | + <div class="col-12"> |
| 15 | + <div class="field"> |
| 16 | + <div class="field-radiobutton"> |
| 17 | + <RadioButton inputId="mfa-option-1" |
| 18 | + name="mfa" |
| 19 | + :data-testid="'general-securities_status_'+store.list.mfa_status" |
| 20 | + value="disable" |
| 21 | + v-model="store.list.mfa_status" /> |
| 22 | + <label for="mfa-option-1">Disable</label> |
| 23 | + </div> |
| 24 | + <div class="field-radiobutton"> |
| 25 | + <RadioButton inputId="mfa-option-2" |
| 26 | + name="mfa" |
| 27 | + :data-testid="'general-securities_status_'+store.list.mfa_status" |
| 28 | + value="all-users" |
| 29 | + v-model="store.list.mfa_status" /> |
| 30 | + <label for="mfa-option-2">Enable for all users</label> |
| 31 | + </div> |
| 32 | + <div class="field-radiobutton"> |
| 33 | + <RadioButton inputId="mfa-option-3" |
| 34 | + name="mfa" |
| 35 | + :data-testid="'general-securities_status_'+store.list.mfa_status" |
| 36 | + value="user-will-have-option" |
| 37 | + v-model="store.list.mfa_status" /> |
| 38 | + <label for="mfa-option-3">Users will have option to enable it</label> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + <div class="field"> |
| 42 | + <h5 class="mb-3 font-semibold text-sm">MFA Methods</h5> |
| 43 | + <div class="field-checkbox"> |
| 44 | + <Checkbox :disabled="store.list.mfa_status === 'disable'" |
| 45 | + :data-testid="'general-securities_status_'+store.list.mfa_methods" |
| 46 | + inputId="binary1" class="is-small" |
| 47 | + v-model="store.list.mfa_methods" |
| 48 | + value="email-otp-verification" /> |
| 49 | + <label for="binary1">Email OTP Verification</label> |
| 50 | + </div> |
| 51 | + <div class="field-checkbox"> |
| 52 | + <Checkbox disabled inputId="binary2" class="is-small" |
| 53 | + :data-testid="'general-securities_status_'+store.list.mfa_methods" |
| 54 | + v-model="store.list.mfa_methods" |
| 55 | + value="sms-otp-verification" /> |
| 56 | + <label for="binary2">SMS OTP Verification</label> |
| 57 | + </div> |
| 58 | + <div class="field-checkbox"> |
| 59 | + <Checkbox disabled inputId="binary3" |
| 60 | + :data-testid="'general-securities_status_'+store.list.mfa_methods" |
| 61 | + class="is-small" |
| 62 | + v-model="store.list.mfa_methods" |
| 63 | + value="authenticator-app" /> |
| 64 | + <label for="binary3">Authenticator App (only user can enable this)</label> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + |
| 68 | + <div class="field"> |
| 69 | + <InputSwitch inputId="switch1" |
| 70 | + data-testid="general-securities_status_is_new_device" |
| 71 | + v-model="store.list.is_new_device_verification_enabled"/> |
| 72 | + <label for="switch1">We will prompt for additional verification when you log in from a new device or browser.</label> |
| 73 | + </div> |
| 74 | + |
| 75 | + <Button label="Save" |
| 76 | + icon="pi pi-save" |
| 77 | + data-testid="general-securities_save" |
| 78 | + @click="store.storeSecuritySettings()" |
| 79 | + class="p-button-sm" |
| 80 | + /> |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + </div> |
| 84 | +</template> |
0 commit comments