Devise / omniauth login with twitter - verification failed: email address cannot be empty

I installed authentication in the rails application using devise, after this tutorial . It works great, the user can register and then log in using email and password.

Now I want to add the ability to register / log in using twitter. I follow the tutorial from reinventing the wiki

The wiki example uses facebook, I changed it to use twitter. He manages to go to twitter and request authorization, so I’m sure that I have the basics. However, as soon as it returns to my application, I get the following error.

Validation failed: Email can't be blank

I guess this is because I cannot provide an email address.

The code I use is identical (except sharing facebook to twitter) with text in textbooks, so I do not post any samples. Please let me know if you want to see something.

I am new to rails, so not sure how to debug. Any tips on how I should proceed?

+5
source share
2 answers

Hey, just remove ": validatable" from user model n, this will allow empty email.worked for me !!

+3
source

I know this question is old, but it still appears, and a quick google search found some very bad tips. So here ...

- , :

def email_required?
  false
end 

"validatable", , , , , , ... , . , .

, - , , 99,99% , , , , .

, .

+2

All Articles