add other login results

This commit is contained in:
Carson McManus 2021-03-25 13:22:42 -04:00
parent 4a90c146e5
commit 748c9b01d0

View file

@ -182,6 +182,26 @@ impl UserLogin {
return LoginResult::TooManyAttempts;
}
if login_resp.message.contains("Incorrect login") {
return LoginResult::BadCredentials;
}
if login_resp.captcha_needed {
return LoginResult::NeedCaptcha;
}
if login_resp.emailauth_needed {
return LoginResult::NeedEmail;
}
if login_resp.requires_twofactor {
return LoginResult::Need2FA;
}
if !login_resp.login_complete {
return LoginResult::BadCredentials;
}
return LoginResult::OtherFailure;
}