mfa fixes
This commit is contained in:
parent
1313e55d98
commit
6c4f6dcd05
2 changed files with 6 additions and 8 deletions
|
|
@ -63,7 +63,7 @@ const LoginForm = {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error === 'mfa_required') {
|
if (error.errorData?.error === 'mfa_required') {
|
||||||
this.requireMFA({ settings: error })
|
this.requireMFA({ settings: error })
|
||||||
} else if (error.identifier === 'password_reset_required') {
|
} else if (error.identifier === 'password_reset_required') {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ const Mfa = {
|
||||||
|
|
||||||
return generateMfaBackupCodes({
|
return generateMfaBackupCodes({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then(({ data: res }) => {
|
||||||
this.backupCodes.codes = res.codes
|
this.backupCodes.codes = res.codes
|
||||||
this.backupCodes.inProgress = false
|
this.backupCodes.inProgress = false
|
||||||
})
|
})
|
||||||
|
|
@ -122,7 +122,7 @@ const Mfa = {
|
||||||
this.setupState.setupOTPState = 'prepare'
|
this.setupState.setupOTPState = 'prepare'
|
||||||
mfaSetupOTP({
|
mfaSetupOTP({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then(({ data: res }) => {
|
||||||
this.otpSettings = res
|
this.otpSettings = res
|
||||||
this.setupState.setupOTPState = 'confirm'
|
this.setupState.setupOTPState = 'confirm'
|
||||||
})
|
})
|
||||||
|
|
@ -135,11 +135,9 @@ const Mfa = {
|
||||||
password: this.currentPassword,
|
password: this.currentPassword,
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.error) {
|
|
||||||
this.error = res.error
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.completeSetup()
|
this.completeSetup()
|
||||||
|
}).catch((error) => {
|
||||||
|
this.error = error
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -161,7 +159,7 @@ const Mfa = {
|
||||||
|
|
||||||
// fetch settings from server
|
// fetch settings from server
|
||||||
async fetchSettings() {
|
async fetchSettings() {
|
||||||
const result = await settingsMFA({
|
const { data: result } = await settingsMFA({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
if (result.error) return
|
if (result.error) return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue