Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Load omniauth from yaml #111

  • Loading branch information...
commit 744dd627a1e91338ac819c99761a0bf7c695d580 1 parent 3451c07
@bitboxer bitboxer authored
Showing with 12 additions and 9 deletions.
  1. +2 −1  .gitignore
  2. +10 −8 config/initializers/devise.rb
View
3  .gitignore
@@ -14,4 +14,5 @@ nbproject/*
rails_best_practices_output.html
public/uploads/*
.powenv
-public/thisiscologne.json
+public/thisiscologne.json
+config/omniauth.yml
View
18 config/initializers/devise.rb
@@ -213,12 +213,14 @@
# manager.intercept_401 = false
# manager.default_strategies(scope: :user).unshift :some_external_strategy
# end
-
- #OmniAuth strategies
- config.omniauth :twitter, ENV['TWITTER_CLIENT_ID'], ENV['TWITTER_SECRET']
- config.omniauth :github, ENV['GITHUB_CLIENT_ID'], ENV['GITHUB_SECRET']
- config.omniauth :facebook, ENV['FACEBOOK_CLIENT_ID'], ENV['FACEBOOK_SECRET']
- config.omniauth :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_SECRET']
- config.omniauth :linkedin, ENV['LINKEDIN_CLIENT_ID'], ENV['LINKEDIN_SECRET']
-
+
+ # OmniAuth strategies
+ omniauth_yaml = File.expand_path("../../omniauth.yml", __FILE__)
+ if File.exist?(omniauth_yaml)
+ yaml = YAML.load_file omniauth_yaml
+ yaml["auth"].keys.each do |key|
+ config.omniauth key.to_sym, yaml["auth"][key]["key"], yaml["auth"][key]["secret"]
+ end
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.