feat: fix MFA empty CountryCode bug and show MFA error better in frontend

This commit is contained in:
Yang Luo
2024-11-04 16:17:24 +08:00
parent 60f979fbb5
commit 457c6098a4
3 changed files with 6 additions and 4 deletions

View File

@ -854,6 +854,7 @@ func (c *ApiController) Login() {
}
if authForm.Passcode != "" {
user.CountryCode = user.GetCountryCode(user.CountryCode)
mfaUtil := object.GetMfaUtil(authForm.MfaType, user.GetPreferredMfaProps(false))
if mfaUtil == nil {
c.ResponseError("Invalid multi-factor authentication type")