Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Episode 236, when register with twitter or facebook #3

Open
TeuF opened this issue Dec 26, 2010 · 5 comments
Open

Episode 236, when register with twitter or facebook #3

TeuF opened this issue Dec 26, 2010 · 5 comments

Comments

@TeuF
Copy link

TeuF commented Dec 26, 2010

Hi,

I have a problem: if I register using twitter or facebook instance, the password field stay blank. Then if the user try to login using email + password

I get the following error:

BCrypt::Errors::InvalidHash in Devise/sessionsController#create
invalid hash

How can I prevent this to happen ?

Thanks a lot.

@jpmckinney
Copy link

This is because the encrypted_password field is empty. Seeding the password with a random string when people create users via Twitter/Facebook/etc. will avoid this problem.

@ryanjm
Copy link

ryanjm commented May 4, 2011

If you do that, won't it stop them from being able to add a password later?

Ideally, it would return saying that email/password is incorrect, right?

@jpmckinney
Copy link

Yes, it would, but if they are logging in with Facebook, they don't need a password on your site (right?).

@ryanjm
Copy link

ryanjm commented May 4, 2011

It's true, I just happen to let the user be able to login multiple ways. Idea is that authentication != identification, so why not let the user be able to login through multiple means?

@jpmckinney
Copy link

In that case, I would require users to set a password on your site when they login with Facebook for the first time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants