Module: Rodauth::Rails::Feature::InternalRequest

Extended by:
ActiveSupport::Concern
Defined in:
lib/rodauth/rails/feature/internal_request.rb

Instance Method Summary collapse

Instance Method Details

#base_urlObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/rodauth/rails/feature/internal_request.rb', line 17

def base_url
  return super unless missing_host? && domain && rails_url_options!

  scheme = rails_url_options[:protocol] || "http"
  port = rails_url_options[:port]

  url = "#{scheme}://#{domain}"
  url << ":#{port}" if port
  url
end

#domainObject



11
12
13
14
15
# File 'lib/rodauth/rails/feature/internal_request.rb', line 11

def domain
  return super unless missing_host? && rails_url_options!

  rails_url_options.fetch(:host)
end

#rails_url_optionsObject



28
29
30
31
# File 'lib/rodauth/rails/feature/internal_request.rb', line 28

def rails_url_options
  return _rails_url_options if frozen? # handle path_class_methods feature
  @rails_url_options ||= _rails_url_options
end