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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -