ruby on rails - How to allow nil password_digest when logged in with FB? -


i'm 3 months learning rails. trying add facebook auth hartl tutorial sample app clone.

i'd still allow users create accounts w/o fb... though i'm open suggestions on that. want fb login happen instantly, without users having enter password.

i've been using relevant railscasts (#235-236, etc.) ryan uses devise, , don't want to. in fact, find complexity of solution argument authentication scratch.

my current bug (after saving user without validation) "password digest missing on new record" , seems caused this. options?

  1. i'm tempted add random password_digest feel little dirty that. should i?
  2. should rewrite sign_in function? needs happen in it? maybe don't understand lifecycle of hartl's remember_token...
  3. is there else i'm missing?

my code on github.

thanks!

the has_secure_password module automatically adds validation: validates_presence_of :password_digest. and, there no way bypass validation.

one solution can think of fallback secured password theory explained in previous version of rails tutorial (http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-two?version=3.0#sec:secure_passwords) , roll authentication mechanism instead of using has_secure_password.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -