Sha256: 6477546896fc89f6078717a0518f6bb59c5e4a25667cf0c283c43b8ce4c1fa9c

Contents?: true

Size: 421 Bytes

Versions: 24

Compression:

Stored size: 421 Bytes

Contents

module Agilibox::BackUrlConcern
  extend ActiveSupport::Concern

  private

  def default_back_url
  end

  def back_url
    url = [
      params[:back_url],
      request.referer,
      default_back_url,
      main_app.try(:root_path),
      "/",
    ].find(&:present?)

    uri = URI.parse(url)
    uri.host = nil
    uri.port = nil
    uri.scheme = nil
    uri.user = nil
    uri.password = nil
    uri.to_s
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
agilibox-2.0.0 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.11.0 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.10.5 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.10.2 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.10.1 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.10.0 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.20 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.19 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.18 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.17 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.16 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.15 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.14 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.13 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.12 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.11 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.10 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.9 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.8 app/controllers/concerns/agilibox/back_url_concern.rb
agilibox-1.9.7 app/controllers/concerns/agilibox/back_url_concern.rb