-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task/add specific failed comment #1994
Conversation
2703caf
to
7743cfa
Compare
7743cfa
to
7944c05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question about a possible db fetch that isn't needed.
app/user/rest.py
Outdated
@@ -230,7 +230,14 @@ def verify_user_password(user_id): | |||
return jsonify({}), 204 | |||
else: | |||
increment_failed_login_count(user_to_verify) | |||
message = "Incorrect password" | |||
# We want to get the user again to check the failed login count | |||
user_to_verify = get_user_by_id(user_id=user_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bother going back to the DB for the user again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cause we increment_failed_login_count in 232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but I think the object is updated in place so I don't think we need to bother with the extra db call!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me look at it again, thanks for pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary | Résumé
Update the error statement so if a user has a failed login more than 10 times, we can set up a cloudwatch alert for it.
Log while testing: