From 974e722a09fc2bf5315316ad1cee2e6734c876e6 Mon Sep 17 00:00:00 2001 From: Ankur Agarwal Date: Fri, 18 Dec 2015 11:32:11 +0530 Subject: [PATCH] Fixes Issue #362: Fixes for the omniauth redirection issue for namespaced model --- .../devise_token_auth/omniauth_callbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb index 48bfdc4df..2813453e0 100644 --- a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +++ b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb @@ -11,7 +11,7 @@ def redirect_callbacks # derive target redirect route from 'resource_class' param, which was set # before authentication. - devise_mapping = request.env['omniauth.params']['resource_class'].underscore.to_sym + devise_mapping = request.env['omniauth.params']['resource_class'].underscore.gsub("/", "_").to_sym redirect_route = "#{request.protocol}#{request.host_with_port}/#{Devise.mappings[devise_mapping].fullpath}/#{params[:provider]}/callback" # preserve omniauth info for success route. ignore 'extra' in twitter