return 422 if account not activated

This commit is contained in:
Son 2022-02-22 22:12:36 +01:00
parent e9d134fe8f
commit 7da06ba424
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ def auth_login():
elif user.disabled:
return jsonify(error="Account disabled"), 400
elif not user.activated:
return jsonify(error="Account not activated"), 400
return jsonify(error="Account not activated"), 422
elif user.fido_enabled():
# allow user who has TOTP enabled to continue using the mobile app
if not user.enable_otp:

View File

@ -22,7 +22,7 @@ def test_auth_login_success(flask_client, mfa: bool):
Session.commit()
r = flask_client.post(
url_for("api.auth_login"),
"/api/auth/login",
json={
"email": "abcd@gmail.com",
"password": PASSWORD_2,