Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:59:02+00:00 2026-06-01T00:59:02+00:00

I am using devise and create login with Facebook using omniauth, but having problem

  • 0

I am using devise and create login with Facebook using omniauth, but having problem of lost the devise helper methods access like current_user and user_signed_in? methods are not working.

EDIT

AuthenticationController

def create
    omniauth = request.env["omniauth.auth"]    
    user = User.find_by_provider_and_uid(omniauth["provider"], omniauth["uid"]) ||       User.create_with_omniauth(omniauth)    
    session[:user_id] = user.id    
    redirect_to dashboard_path(user.id), :notice => "Signed in!"    
end  

redirect_to USercontroller dashboard method

UserController

before_filter  :logged_in

 def dashboard    
    @user = User.find(params[:id])   
    @comment = Comment.new    
    @comments = @user.comments.all.paginate(:page => params[:page], :per_page => 5)    
 end 

so here control should go to dashboard method after checking logged_in method in ApplicationController

logged_in method in ApplicationController

Application Controller

def logged_in    
    if user_signed_in?     
       return true    
    else    
       redirect_to root_path    
       flash[:message] = "please login"    
    end     
  end 

when I logged in using facebook following code generated at console

Started GET "/users/52/dashboard" for 127.0.0.1 at Thu Mar 29 12:51:55 +0530 2012     
Processing by UsersController#dashboard as HTML     
  Parameters: {"id"=>"52"}     
Redirected to http://localhost:3000/     
Filter chain halted as :logged_in rendered or redirected     
Completed 302 Found in 2ms (ActiveRecord: 0.0ms)     

in the above code control is render from logged_in method to root_path but it shold render dashboard_path

So I am guessing User_signed_in? helper is not working I also use current_user in stead of that generate same error

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:59:04+00:00Added an answer on June 1, 2026 at 12:59 am

    As I see, user_signed_in? is working, but returns false, as for Devise user is not logged in. To fix this, just replace the session id storing with Devise sign_in method in your controller action:

    def create
        omniauth = request.env["omniauth.auth"]    
        user = User.find_by_provider_and_uid(omniauth["provider"], omniauth["uid"]) ||       User.create_with_omniauth(omniauth)    
        sign_in(:user, user)
    
        # actually if you really really need that id in the session, you can leave this line too :)
        session[:user_id] = user.id 
    
        redirect_to dashboard_path(user.id), :notice => "Signed in!"    
    end 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Rails, Devise, and Omniauth, and I'm trying to login using facebook connect.
I'm using OmniAuth with Devise to allow users to login with facebook or to
I have successfully implemented login with Facebook using Devise and OmniAuth (built into Devise).
I'm want to test my login through facebook. Im using pure omniauth, w/o Devise.
I'm using omniauth and devise to log users in with their facebook acounts, everything
I have a problem using devise with an AJAX login. I'm using the :remote
Im using devise with omniauth for signing in users with facebook. I want them
We have a web app running on Rails, using Devise and OmniAuth for user
There is a lot of information about using OmniAuth and Devise to be able
I am using Rails 3 and Devise to create an app where users arrive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.