Skip to content
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

Failed_attempts not set to 0, after resetting password #1720

Closed
adahl opened this issue Mar 15, 2012 · 5 comments
Closed

Failed_attempts not set to 0, after resetting password #1720

adahl opened this issue Mar 15, 2012 · 5 comments
Labels

Comments

@adahl
Copy link
Contributor

adahl commented Mar 15, 2012

When you do a normal sign in, failed_attempts is set to 0.

However, if a user fails to sign in a few times and then resets their password, they are logged in, but failed_attempts is no set to 0.

This seems like a bug? at least it is causing me some issues. Specifically, I show a recaptcha after a certain number of failed attempts (3). Normally a user will see the recaptcha and then reset their password. They are logged in upon password reset, but next time they come to login, the recaptcha is shown again, because the failed_attempts have not been reset.

  • Andrew
@rodrigoflores
Copy link
Contributor

@adahl

Thanks for posting this. We're discussing if this is a bug or not. I understand your point of view, however, conceptually seems reasonable to only reset it after a successful_attempt. But, for now, you can do a quick workaround for it: there is a callback after the password reset. You can use it to reset the failed attempt field.

Fell free to ping us if it doesn't work.

def after_password_reset
  self.failed_attempts = 0
  self.save(:validate => false)
end

@adahl
Copy link
Contributor Author

adahl commented Mar 16, 2012

Great, thanks. I will use that for now. Please let me know what you end up
deciding.

On Fri, Mar 16, 2012 at 21:31, Rodrigo Flores <
reply@reply.github.com

wrote:

@adahl

Thanks for posting this. We're discussing if this is a bug or not. I
understand your point of view, however, conceptually seems reasonable to
only reset it after a successful_attempt. But, for now, you can do a quick
workaround for it: there is a callback after the password reset. You can
use it to reset the failed attempt field.

def after_password_reset
 self.failed_attempts = 0
 self.save(:validate => false)
end

Reply to this email directly or view it on GitHub:
#1720 (comment)

@rodrigoflores
Copy link
Contributor

@adahl

We discussed and decided that this is a bug.

@rodrigoflores
Copy link
Contributor

@adahl

Can you point your Devise entry on your Gemfile to devise repository and see if it works as expected? We merged a pull request that fixes it.

@adahl
Copy link
Contributor Author

adahl commented Mar 20, 2012

It works as expected. Thanks for the fix. Will this be out in the next release and when do you think it will be out?

  • Andrew

On 19/03/2012, at 22.15, Rodrigo Flores wrote:

@adahl

Can you point your Devise entry on your Gemfile to devise repository and see if it works as expected? We merged a pull request that fixes it.


Reply to this email directly or view it on GitHub:
#1720 (comment)

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

No branches or pull requests

2 participants