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 7884633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:51:09+00:00 2026-06-03T04:51:09+00:00

Can anyone help me get to the bottom of this problem? I’m using Devise

  • 0

Can anyone help me get to the bottom of this problem?

I’m using Devise + Omniauth in a Rails 3.2 app. What I want to know is, what’s happening behind the scenes with Devise’s user_omniauth_authorize_path(provider) method.

I’ve had a dig through rake routes and the gem’s source, but I can’t see anything obvious that would cause the issue I’m having.

I assume this method simply calls the provider’s signin url (e.g. Twitter) and then returns to the callback path defined in routes.rb.

In my routes.rb I have

devise_for :users, :controllers => { :omniauth_callbacks => 'users/omniauth_callbacks'}

devise_scope :user do
    get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end

In users/omniauth_callbacks_controller.rb I have

def twitter
    render :text => "This works" 
end

def passthru
    render :text => "This doesn't work"
end

In a view I have <%= link_to "Twitter", user_omniauth_authorize_path(:twitter) %>. Clicking this link goes to Twitter where I can log in, but upon return to my app I get an error “You are already signed in”.

I can’t work out how or why this error is being generated. I should only be seeing “This works” or “This doesn’t work”.

I also have a Facebook provider set up in exactly the same way, and this works as expected.

If I replace Devise’s omniauth link with <a href="/users/auth/twitter">Twitter</a> then I get “This works”.

So this solves my issue, but its not ideal and I’d like to know why.

Can anyone shed any light?

EDIT

Rake routes looks like this:

user_omniauth_callback        /users/auth/:action/callback(.:format)                       users/omniauth_callbacks#(?-mix:twitter|facebook)
  • 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-03T04:51:10+00:00Added an answer on June 3, 2026 at 4:51 am

    Well, it is working for me, so it is definitely something on your end. First of all, have you compared in the console the GET calls /users/auth/twitter and /users/auth/twitter?callback obtained by the 2 different methods? They should look exactly the same (except for the token and the verifier, of course).

    Now, I’m not sure if this is related, but with devise you don’t use a passthru route, so you can remove that route. Instead, in your callbacks controller, you should implement an action called failure that handles a bad request. See here for devise’s implementation.

    I’m grasping at straws here, but you should also have this at the end of your callbacks controller:

    # This is necessary since Rails 3.0.4
    # See https://github.com/intridea/omniauth/issues/185
    # and http://www.arailsdemo.com/posts/44
    protected
    def handle_unverified_request
      true
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me to get the JPA criteria query for the JPA query
Can anyone help me with the question. I'm trying to get msmq messages count
Can Any one help me reading this XML and Looping through <MedicationDispensed> I get
Can anyone help? I have been using the entity framework and its going well
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
internet cake for anyone who can help me with this. I have a long
I'm using jQuery qTip2 for tooltips in my Rails app. I want the tooltip
can anyone help me in trying to check whether JavaScript is enabled in client
can anyone help me with construction of an IF in a stored procedure in
can anyone help? I have a simple html file which i am filling via

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.