From 3db5d65ad76b7fcc7858ecc1fc6ec3edafd72667 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 25 Aug 2013 13:53:31 +0200 Subject: [PATCH] omniauth_secrets added --- .gitignore | 1 + config/initializers/devise.rb | 3 ++- config/omniauth_secrets.yml.example | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 config/omniauth_secrets.yml.example diff --git a/.gitignore b/.gitignore index a43cb4b..0747299 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/config/omniauth_secrets.yml /config/initializers/omniauth_secrets.rb # See http://help.github.com/ignore-files/ for more about ignoring files. # diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index b51a43e..3c6e41a 100755 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -224,7 +224,8 @@ Devise.setup do |config| # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. #config.omniauth :facebook, 'appid', 'secret' - + secrets = YAML.load_file("#{::Rails.root.to_s}/config/omniauth_secrets.yml") +config.omniauth :facebook, secrets["facebook"]["appid"], secrets["facebook"]["secret"] # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. diff --git a/config/omniauth_secrets.yml.example b/config/omniauth_secrets.yml.example new file mode 100644 index 0000000..3ec8a3d --- /dev/null +++ b/config/omniauth_secrets.yml.example @@ -0,0 +1,4 @@ + +facebook: + appid: "" + secret: ""