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

password length #380

Closed
ghost opened this issue Sep 18, 2015 · 2 comments
Closed

password length #380

ghost opened this issue Sep 18, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2015

I have my devise configured with :

config.password_length = 8..128

When a user tries to register with a password < 8 character a message is displayed :
"password can't be blank" "Password confirmation != password" .... but the real reason was because it have < 8 chars. So I changed my model to have:

validates :password, length: {in: 8..128}

And I succeed to get the following error:
"password can't be blank" "Password confirmation != password" "password have < than 8 chars"

As a user I succeed to register with a password >= 8 chars. I receive a confirmation email, but when I press the confirmation link I get the following error:

ActiveRecord::RecordInvalid (A validação falhou: Password é demasiado pequeno (o mínimo é de 8 caracteres)):
activerecord (4.2.0) lib/active_record/validations.rb:79:in raise_record_invalid' activerecord (4.2.0) lib/active_record/validations.rb:43:insave!'

A validação falhou: Password é demasiado pequeno (o mínimo é de 8 caracteres = The validation failed. Password is too short (the minimum is 8 chars).

What can be wrong ?

@fabiancarlos
Copy link

Well, this is a bug when using token_auth, i just removed the validation of lenght password. Try to setting a before filter and validate it manually.

@ghost
Copy link
Author

ghost commented Nov 25, 2015

Thanks fabiancarlos. Forgot that I had this open. This is not a devise problem, is true. Thanks for your support.
I will close this issue.

@ghost ghost closed this as completed Nov 25, 2015
This issue was closed.
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

No branches or pull requests

1 participant