#925·omniauth

Can't override the passthrough route

Author: samst-testCreated Jan 11, 2018Updated Nov 23, 2023

Please complete all sections.

Configuration

  • Provider Gem: omniauth-slack
  • Ruby Version: 2.3.1.
  • Framework: Rails 5.1.4
  • Platform: Mac OS X

Expected Behavior

If I run rake routes, then I see the following two routes:

user_slack_omniauth_authorize GET|POST /users/auth/slack(.:format)          omniauth_callbacks#passthru
 user_slack_omniauth_callback GET|POST /users/auth/slack/callback(.:format) omniauth_callbacks#slack

If I override passthru in my controller like this:

class OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def slack
    # snip
  end

  def passthru
    raise "Hello!"
    super
  end
end

...then I would expect an exception to be raised. Instead,

Actual Behavior

I just get a 302 to https://slack.com/oauth/authorize. I don't see my controller handling any requests in the log:

Started GET "/users/auth/slack" for 127.0.0.1 at 2018-01-11 09:40:24 +0100
I, [2018-01-11T09:40:24.140757 #82583]  INFO -- omniauth: (slack) Request phase initiated.

My routes.rb includes this:

devise_for :users, controllers: { omniauth_callbacks: 'omniauth_callbacks' }