Last active
December 27, 2015 00:19
-
-
Save jirikolarik/7237231 to your computer and use it in GitHub Desktop.
Devise + OmniAuth in engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyEngine::Engine.routes.draw do | |
devise_scope :user do | |
providers = Regexp.union(Devise.omniauth_providers.map(&:to_s)) | |
match 'users/auth/:provider', | |
constraints: { provider: providers }, | |
to: 'omniauth_callbacks#passthru', | |
as: :omniauth_authorize, | |
via: [:get, :post] | |
match 'users/auth/:action/callback', | |
constraints: { action: providers }, | |
to: 'omniauth_callbacks', | |
as: :omniauth_callback, | |
via: [:get, :post] | |
end | |
devise_for :users, class_name: 'MyEngine::User', module: :devise | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment