ruby - Rails 4.0 User Authentication With Devise + Omniauth -


i understand don't have facebook set yet (that seems similar different beast), right now, based on understanding, should able sign in twitter username , "you signed in!" , display username says

<span>logged in <%= current_user.username %>.</span> 

also, on separate note, love know why flash.notice isn't working me. deprecated in rails 4 or missing in application.html.erb file them show?

i'm working from: http://railscasts.com/episodes/235-devise-and-omniauth-revised

here code i'm working with.

https://github.com/erosenberg/devise-app

edit: ok, sorry wasn't specific, figured wall of text less responses shortened it.

essentially i'm trying work railscast devise working omniauth. in past i've gotten omniauth devise working on own, , bringing them has been whole new challenge -- considering every tutorial has told me different way , of them seem outdated. way have set way railscast recommends -- add omniauthcallbacks controller, seems not anything. when try signing in twitter using app, takes me sign-in page, however, when try signing in email address, works , takes me "dashboard" i've created. reason twitter login isn't working, , able test using flash[:notice] reason isn't working either. facebook login working , have user able merge account twitter or facebook.

if need me explain in further detail, can try too. thanks!

in config/initializers/devise.rb didn't change config.

config.authentication_keys = [ :email ] 

which means using email authenticate default. code missing saving user's email or validate failed.

you can either change authentication_key or save email.

edit

ok after clone app , run on machine. i'm sure it's because email validation failed. because when using devise generetor create migration file here, devise validate email has presence default.

t.string :email,              :null => false, :default => "" 

so can rollback change migration remote ':null => false'. after add code user user model:

def email_required?   false end 

and don't forget change config correct authenticate key.

config.case_insensitive_keys = [ :username ] config.strip_whitespace_keys = [ :username ] 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -