Skip to content

Instantly share code, notes, and snippets.

@mokus80
Created April 6, 2014 11:01
Show Gist options
  • Save mokus80/10004506 to your computer and use it in GitHub Desktop.
Save mokus80/10004506 to your computer and use it in GitHub Desktop.
Rails.application.config.middleware.use OmniAuth::Builder do
yaml_file_path = "#{Rails.root}/config/github.yml"
local_env_path = "#{Rails.root}/config/local_env.yml"
if File.exists? (yaml_file_path)
config = YAML.load_file(yaml_file_path)
client_id = config['CLIENT_ID']
secret = config['CLIENT_SECRET']
else
client_id = config['CLIENT_ID']
secret = config['CLIENT_SECRET']
end
provider :github, client_id, secret
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment