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:
|
elif user.disabled:
|
||||||
return jsonify(error="Account disabled"), 400
|
return jsonify(error="Account disabled"), 400
|
||||||
elif not user.activated:
|
elif not user.activated:
|
||||||
return jsonify(error="Account not activated"), 400
|
return jsonify(error="Account not activated"), 422
|
||||||
elif user.fido_enabled():
|
elif user.fido_enabled():
|
||||||
# allow user who has TOTP enabled to continue using the mobile app
|
# allow user who has TOTP enabled to continue using the mobile app
|
||||||
if not user.enable_otp:
|
if not user.enable_otp:
|
||||||
|
|
|
@ -22,7 +22,7 @@ def test_auth_login_success(flask_client, mfa: bool):
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
r = flask_client.post(
|
r = flask_client.post(
|
||||||
url_for("api.auth_login"),
|
"/api/auth/login",
|
||||||
json={
|
json={
|
||||||
"email": "abcd@gmail.com",
|
"email": "abcd@gmail.com",
|
||||||
"password": PASSWORD_2,
|
"password": PASSWORD_2,
|
||||||
|
|
Loading…
Reference in a new issue