Sha256: 0ac0c824b302cbac8ffe732b8833547e6315878b70392efa081ef17f9ca5c58f

Contents?: true

Size: 576 Bytes

Versions: 2

Compression:

Stored size: 576 Bytes

Contents

class G5Authenticatable::FailureApp < Devise::FailureApp
  def scope_url
    opts  = {}
    route = :"new_#{scope}_session_url"
    opts[:format] = request_format unless skip_format?

    config = Rails.application.config

    # See https://github.com/G5/g5_authenticatable/issues/25
    opts[:script_name] = config.relative_url_root if config.try(:relative_url_root)

    context = send(Devise.available_router_name)

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_authenticatable-0.5.0 app/controllers/g5_authenticatable/failure_app.rb
g5_authenticatable-0.4.2 app/controllers/g5_authenticatable/failure_app.rb