ruby on rails - Logging with OmniAuth and Devise RoR 5 -
i following docs here link.
this users::omniauthcallbackscontroller
facebook
method:
def facebook # need implement method below in model (e.g. app/models/user.rb) @user = user.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? logger.debug "yes" sign_in_and_redirect @user, :event => :authentication #this throw if @user not activated set_flash_message(:notice, :success, :kind => "facebook") if is_navigational_format? else logger.debug "no" session["devise.facebook_data"] = request.env["omniauth.auth"] end end
this part of 'application.html.erb' view
<h1><%=user_signed_in? %></h1>
if try login facebook creates new row in users
table user, works, see user_signed_in?
false
. need authenticate devise , omniauth ?
Comments
Post a Comment