Sha256: fbd00d4aef5e9231746492dd821c66a5858362f56c8657ba414624441e3641d2

Contents?: true

Size: 1 KB

Versions: 41

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module Decidim
  # We've provided a custom class in order to be able to deactivate the
  # script_name hack that doesn't seem to be affecting us (it is actually
  # introducing a bug).
  class DeviseFailureApp < ::Devise::FailureApp
    def scope_url
      opts = {}

      # Initialize script_name with nil to prevent infinite loops in
      # authenticated mounted engines in rails 4.2 and 5.0

      # The line below is what we commented LOL ^^
      # opts[:script_name] = nil

      route = route(scope)

      opts[:locale] = params[:locale] if params[:locale]
      opts[:format] = request_format unless skip_format?

      opts[:script_name] = relative_url_root if relative_url_root?

      router_name = ::Devise.mappings[scope].router_name || ::Devise.available_router_name
      context = send(router_name)

      if context.respond_to?(route)
        context.send(route, opts)
      elsif respond_to?(:root_url)
        root_url(opts)
      else
        "/"
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
decidim-core-0.9.3 lib/decidim/devise_failure_app.rb
decidim-core-0.9.2 lib/decidim/devise_failure_app.rb
decidim-core-0.9.1 lib/decidim/devise_failure_app.rb
decidim-core-0.9.0 lib/decidim/devise_failure_app.rb
decidim-core-0.8.4 lib/decidim/devise_failure_app.rb
decidim-core-0.8.3 lib/decidim/devise_failure_app.rb
decidim-core-0.8.2 lib/decidim/devise_failure_app.rb
decidim-core-0.8.1 lib/decidim/devise_failure_app.rb
decidim-core-0.8.0 lib/decidim/devise_failure_app.rb
decidim-core-0.7.4 lib/decidim/devise_failure_app.rb
decidim-core-0.7.3 lib/decidim/devise_failure_app.rb
decidim-core-0.7.2 lib/decidim/devise_failure_app.rb
decidim-core-0.7.1 lib/decidim/devise_failure_app.rb
decidim-core-0.7.0 lib/decidim/devise_failure_app.rb
decidim-core-0.6.8 lib/decidim/devise_failure_app.rb
decidim-0.6.8 decidim-core/lib/decidim/devise_failure_app.rb
decidim-core-0.6.7 lib/decidim/devise_failure_app.rb
decidim-0.6.7 decidim-core/lib/decidim/devise_failure_app.rb
decidim-core-0.6.6 lib/decidim/devise_failure_app.rb
decidim-0.6.6 decidim-core/lib/decidim/devise_failure_app.rb