return 422 if account not activated
This commit is contained in:
parent
e9d134fe8f
commit
7da06ba424
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue