Skip to content

Conversation

@CodeRhymesLife
Copy link

Addresses #214 where there is no way to be notified when a user attempts to login with an incorrect password.

These changes:

  • Create a signal for invalid password
  • Fire signal when user's password is invalid
  • Update documentation

* Fire signal when user attempts to login with invalid password
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@a379fa0). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #230   +/-   ##
=========================================
  Coverage          ?   90.64%           
=========================================
  Files             ?       25           
  Lines             ?     1454           
  Branches          ?        0           
=========================================
  Hits              ?     1318           
  Misses            ?      136           
  Partials          ?        0
Impacted Files Coverage Δ
flask_user/signals.py 100% <100%> (ø)
flask_user/forms.py 98.12% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a379fa0...94ff450. Read the comment docs.

@jameshanlon
Copy link

@lingthio Can this be merged yet?!

Copy link
Collaborator

@and-semakin and-semakin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @CodeRhymesLife! Thank you a lot for your contribution! It's a really important functionality. I like that you updated docs and added a recipe :) I just have a suggestion before we can merge it.


# Send user_password_failed signal
else:
signals.user_password_failed.send(current_app._get_current_object(), user=user)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that more appropriate place for this code is somewhere around here. Actually user_logged_in is sent from that file too. So to not place this events (user logged in and authentication failed) too far from each other I would prefer both of them to be fired from user_manager__views.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants