1
0
Fork 0

feat(org): Further work on account pages

This commit is contained in:
joostdecock 2023-02-19 20:49:15 +01:00
parent c0571d54f0
commit 79434846b6
18 changed files with 822 additions and 80 deletions

View file

@ -519,7 +519,10 @@ UserModel.prototype.guardedMfaUpdate = async function ({ body, user, ip }) {
log.warn(err, 'Could not disable MFA after token check')
return this.setResponse(500, 'mfaDeactivationFailed')
}
return this.setResponse(200, false, {})
return this.setResponse(200, false, {
result: 'success',
account: this.asAccount(),
})
} else {
console.log('token check failed')
return this.setResponse(401, 'authenticationFailed')
@ -537,7 +540,10 @@ UserModel.prototype.guardedMfaUpdate = async function ({ body, user, ip }) {
log.warn(err, 'Could not enable MFA after token check')
return this.setResponse(500, 'mfaActivationFailed')
}
return this.setResponse(200, false, {})
return this.setResponse(200, false, {
result: 'success',
account: this.asAccount(),
})
} else return this.setResponse(403, 'mfaTokenInvalid')
}
// Enroll