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