Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

username and password don't seem to be respected #30

Open
dudo opened this issue Aug 16, 2018 · 0 comments
Open

username and password don't seem to be respected #30

dudo opened this issue Aug 16, 2018 · 0 comments

Comments

@dudo
Copy link

dudo commented Aug 16, 2018

This is my code... I'm still asked to login, though. Any idea? username and password are definitely correct.

def _reverse_proxy(endpoint=nil)
  @url = Settings.wordpress.url
  @path ||= [endpoint, params[:path]].compact.join.gsub('//', '/')
  reverse_proxy @url, options do |config|
    config.on_missing do |code, response|
      redirect_to root_url and return
    end
  end
end

def options
  source_request = URI(@url)
  {
    headers:    {
      "HOST" => source_request.host,
      "X-Forwarded-Host" => source_request.host,
      "X-Forwarded-Port" => source_request.port.to_s,
      "X-Forwarded-Proto" => source_request.scheme,
    },
    path: @path,
    username: Settings.wordpress.username,
    password: Settings.wordpress.password,
    verify_ssl: Rails.env.production?
  }.with_indifferent_access
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant