prematurely 2fa switched before 2fa was set fix

This commit is contained in:
Čarodej
2022-03-08 08:51:31 +01:00
parent 08175d4dba
commit c0ca83193f
3 changed files with 9 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<?php
return [
'version' => '2.0.0-Rc.1',
'version' => '2.0.0-Rc.2',
'is_demo' => env('APP_DEMO', false),

View File

@@ -18,7 +18,7 @@
<script>
export default {
name: 'SwitchInput',
props: ['label', 'name', 'state', 'info', 'input'],
props: ['label', 'name', 'state', 'info', 'input', 'isDisabled'],
data() {
return {
isSwitched: undefined,
@@ -26,6 +26,8 @@ export default {
},
methods: {
changeState() {
if (this.isDisabled) return
this.isSwitched = !this.isSwitched
this.$emit('input', this.isSwitched)
},

View File

@@ -11,6 +11,8 @@
:is-last="!user.data.attributes.two_factor_authentication"
>
<SwitchInput
@click.native="toggle2Fa"
:is-disabled="true"
v-model="user.data.attributes.two_factor_authentication"
class="switch"
:state="user.data.attributes.two_factor_authentication"
@@ -169,11 +171,6 @@ export default {
computed: {
...mapGetters(['user']),
},
watch: {
'user.data.attributes.two_factor_authentication': function (val) {
val ? this.enable2faPopup() : this.disable2faPopup()
},
},
data() {
return {
passwordForm: {
@@ -186,6 +183,9 @@ export default {
}
},
methods: {
toggle2Fa() {
this.user.data.attributes.two_factor_authentication ? this.disable2faPopup() : this.enable2faPopup()
},
async resetPassword() {
// Validate fields
const isValid = await this.$refs.password.validate()