diff --git a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb index a9dd78c16..af7a905a0 100644 --- a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +++ b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb @@ -11,9 +11,7 @@ def redirect_callbacks # derive target redirect route from 'resource_class' param, which was set # before authentication. - devise_mapping = [request.env['omniauth.params']['namespace_name'], - request.env['omniauth.params']['resource_class'].underscore.gsub('/', '_')].compact.join('_') - path = "#{Devise.mappings[devise_mapping.to_sym].fullpath}/#{params[:provider]}/callback" + path = "#{devise_mapping.fullpath}/#{params[:provider]}/callback" klass = request.scheme == 'https' ? URI::HTTPS : URI::HTTP redirect_route = klass.build(host: request.host, port: request.port, path: path).to_s