From b79193501849222c9865e3be8484bf96327f2419 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Thu, 19 Dec 2019 21:33:43 -0500 Subject: [PATCH] mfa login working with authenticator --- src/_store/account.module.js | 9 +++++---- src/auth/MultifactorAuthPage.vue | 14 +++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/_store/account.module.js b/src/_store/account.module.js index 22df0d9..2684a91 100644 --- a/src/_store/account.module.js +++ b/src/_store/account.module.js @@ -24,13 +24,13 @@ const actions = { if (user.token) { const landing = getLandingPage(); if (landing === null) { - router.push('/'); + router.replace('/'); } else { resetLandingPage(); - router.push(landing.fullPath); + router.replace(landing.fullPath); } } else if (user.multifactorAuth) { - router.push('/auth'); + router.replace('/auth'); } }, error => { @@ -100,7 +100,7 @@ const actions = { commit('sendAuthenticatorCodeRequest'); userService.sendAuthenticatorCode(uuid, code, verifyOnly, messages, errors) .then( - policy => commit('sendAuthenticatorCodeSuccess', policy), + user => commit('sendAuthenticatorCodeSuccess', user), error => commit('sendAuthenticatorCodeFailure', error) ); } @@ -171,6 +171,7 @@ const mutations = { state.actionStatus = { requesting: true, type: 'approve' }; }, sendAuthenticatorCodeSuccess(state, user) { + console.log("sendAuthenticatorCodeSuccess: user="+JSON.stringify(user)); state.actionStatus = { success: true, type: 'approve', result: user }; if (user.token) state.user = user; }, diff --git a/src/auth/MultifactorAuthPage.vue b/src/auth/MultifactorAuthPage.vue index 9cfa222..0169b65 100644 --- a/src/auth/MultifactorAuthPage.vue +++ b/src/auth/MultifactorAuthPage.vue @@ -31,6 +31,7 @@