diff --git a/app/api/views/auth.py b/app/api/views/auth.py index 878c91c5..7a963ac7 100644 --- a/app/api/views/auth.py +++ b/app/api/views/auth.py @@ -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: diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py index 0ced84c0..61428c11 100644 --- a/tests/api/test_auth.py +++ b/tests/api/test_auth.py @@ -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,