add abortMFA
This commit is contained in:
parent
f1e8edab11
commit
30f054a628
|
@ -14,7 +14,7 @@ export default {
|
||||||
...mapState({ instance: 'instance' })
|
...mapState({ instance: 'instance' })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations({ requireTOTP: 'authFlow/requireTOTP' }),
|
...mapMutations('authFlow', ['requireTOTP', 'abortMFA']),
|
||||||
...mapActions({ login: 'authFlow/login' }),
|
...mapActions({ login: 'authFlow/login' }),
|
||||||
clearError () { this.error = false },
|
clearError () { this.error = false },
|
||||||
submit () {
|
submit () {
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
<a href="#" @click.prevent="requireTOTP">
|
<a href="#" @click.prevent="requireTOTP">
|
||||||
{{$t('login.enter_two_factor_code')}}
|
{{$t('login.enter_two_factor_code')}}
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" @click.prevent="abortMFA">
|
||||||
|
{{$t('general.cancel')}}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<button type='submit' class='btn btn-default'>
|
<button type='submit' class='btn btn-default'>
|
||||||
{{$t('general.verify')}}
|
{{$t('general.verify')}}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default {
|
||||||
...mapState({ instance: 'instance' })
|
...mapState({ instance: 'instance' })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations({ requireRecovery: 'authFlow/requireRecovery' }),
|
...mapMutations('authFlow', ['requireRecovery', 'abortMFA']),
|
||||||
...mapActions({ login: 'authFlow/login' }),
|
...mapActions({ login: 'authFlow/login' }),
|
||||||
clearError () { this.error = false },
|
clearError () { this.error = false },
|
||||||
submit () {
|
submit () {
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
<a href="#" @click.prevent="requireRecovery">
|
<a href="#" @click.prevent="requireRecovery">
|
||||||
{{$t('login.enter_recovery_code')}}
|
{{$t('login.enter_recovery_code')}}
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" @click.prevent="abortMFA">
|
||||||
|
{{$t('general.cancel')}}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<button type='submit' class='btn btn-default'>
|
<button type='submit' class='btn btn-default'>
|
||||||
{{$t('general.verify')}}
|
{{$t('general.verify')}}
|
||||||
|
|
|
@ -13,6 +13,12 @@ const state = {
|
||||||
initStrategy: PASSWORD_STRATEGY // default strategy from config
|
initStrategy: PASSWORD_STRATEGY // default strategy from config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resetState = (state) => {
|
||||||
|
state.strategy = state.initStrategy
|
||||||
|
state.settings = {}
|
||||||
|
state.app = null
|
||||||
|
}
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
const getters = {
|
const getters = {
|
||||||
app: (state, getters) => {
|
app: (state, getters) => {
|
||||||
|
@ -60,10 +66,8 @@ const mutations = {
|
||||||
requireTOTP (state) {
|
requireTOTP (state) {
|
||||||
state.strategy = TOTP_STRATEGY
|
state.strategy = TOTP_STRATEGY
|
||||||
},
|
},
|
||||||
reset (state) {
|
abortMFA (state) {
|
||||||
state.strategy = state.initStrategy
|
resetState(state)
|
||||||
state.settings = {}
|
|
||||||
state.app = null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +76,7 @@ const actions = {
|
||||||
async login ({state, dispatch, commit}, {access_token}) {
|
async login ({state, dispatch, commit}, {access_token}) {
|
||||||
commit('setToken', access_token, { root: true })
|
commit('setToken', access_token, { root: true })
|
||||||
await dispatch('loginUser', access_token, { root: true })
|
await dispatch('loginUser', access_token, { root: true })
|
||||||
commit('reset')
|
resetState(state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue