mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
prematurely 2fa switched before 2fa was set fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => '2.0.0-Rc.1',
|
'version' => '2.0.0-Rc.2',
|
||||||
|
|
||||||
'is_demo' => env('APP_DEMO', false),
|
'is_demo' => env('APP_DEMO', false),
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'SwitchInput',
|
name: 'SwitchInput',
|
||||||
props: ['label', 'name', 'state', 'info', 'input'],
|
props: ['label', 'name', 'state', 'info', 'input', 'isDisabled'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isSwitched: undefined,
|
isSwitched: undefined,
|
||||||
@@ -26,6 +26,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeState() {
|
changeState() {
|
||||||
|
if (this.isDisabled) return
|
||||||
|
|
||||||
this.isSwitched = !this.isSwitched
|
this.isSwitched = !this.isSwitched
|
||||||
this.$emit('input', this.isSwitched)
|
this.$emit('input', this.isSwitched)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
:is-last="!user.data.attributes.two_factor_authentication"
|
:is-last="!user.data.attributes.two_factor_authentication"
|
||||||
>
|
>
|
||||||
<SwitchInput
|
<SwitchInput
|
||||||
|
@click.native="toggle2Fa"
|
||||||
|
:is-disabled="true"
|
||||||
v-model="user.data.attributes.two_factor_authentication"
|
v-model="user.data.attributes.two_factor_authentication"
|
||||||
class="switch"
|
class="switch"
|
||||||
:state="user.data.attributes.two_factor_authentication"
|
:state="user.data.attributes.two_factor_authentication"
|
||||||
@@ -169,11 +171,6 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['user']),
|
...mapGetters(['user']),
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
'user.data.attributes.two_factor_authentication': function (val) {
|
|
||||||
val ? this.enable2faPopup() : this.disable2faPopup()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
passwordForm: {
|
passwordForm: {
|
||||||
@@ -186,6 +183,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toggle2Fa() {
|
||||||
|
this.user.data.attributes.two_factor_authentication ? this.disable2faPopup() : this.enable2faPopup()
|
||||||
|
},
|
||||||
async resetPassword() {
|
async resetPassword() {
|
||||||
// Validate fields
|
// Validate fields
|
||||||
const isValid = await this.$refs.password.validate()
|
const isValid = await this.$refs.password.validate()
|
||||||
|
|||||||
Reference in New Issue
Block a user