adds omniauth and omniauth-twitter gems and initializer with references to secrets
This commit is contained in:
5
Gemfile
5
Gemfile
@@ -21,6 +21,11 @@ gem 'turbolinks'
|
|||||||
gem 'devise'
|
gem 'devise'
|
||||||
# Use ActiveModel has_secure_password
|
# Use ActiveModel has_secure_password
|
||||||
# gem 'bcrypt', '~> 3.1.7'
|
# gem 'bcrypt', '~> 3.1.7'
|
||||||
|
gem 'omniauth'
|
||||||
|
gem 'omniauth-twitter'
|
||||||
|
# gem 'omniauth-facebook'
|
||||||
|
# gem 'omniauth-google-oauth2'
|
||||||
|
|
||||||
gem 'kaminari'
|
gem 'kaminari'
|
||||||
gem 'acts_as_commentable_with_threading'
|
gem 'acts_as_commentable_with_threading'
|
||||||
gem 'acts-as-taggable-on'
|
gem 'acts-as-taggable-on'
|
||||||
|
|||||||
13
Gemfile.lock
13
Gemfile.lock
@@ -150,6 +150,7 @@ GEM
|
|||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
groupdate (2.4.0)
|
groupdate (2.4.0)
|
||||||
activesupport (>= 3)
|
activesupport (>= 3)
|
||||||
|
hashie (3.4.2)
|
||||||
highline (1.7.3)
|
highline (1.7.3)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
@@ -195,6 +196,16 @@ GEM
|
|||||||
netrc (0.10.3)
|
netrc (0.10.3)
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.6.2)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile (~> 0.6.0)
|
||||||
|
oauth (0.4.7)
|
||||||
|
omniauth (1.2.2)
|
||||||
|
hashie (>= 1.2, < 4)
|
||||||
|
rack (~> 1.0)
|
||||||
|
omniauth-oauth (1.1.0)
|
||||||
|
oauth
|
||||||
|
omniauth (~> 1.0)
|
||||||
|
omniauth-twitter (1.2.1)
|
||||||
|
json (~> 1.3)
|
||||||
|
omniauth-oauth (~> 1.1)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paranoia (2.1.3)
|
paranoia (2.1.3)
|
||||||
activerecord (~> 4.0)
|
activerecord (~> 4.0)
|
||||||
@@ -362,6 +373,8 @@ DEPENDENCIES
|
|||||||
kaminari
|
kaminari
|
||||||
launchy
|
launchy
|
||||||
letter_opener_web (~> 1.3.0)
|
letter_opener_web (~> 1.3.0)
|
||||||
|
omniauth
|
||||||
|
omniauth-twitter
|
||||||
paranoia
|
paranoia
|
||||||
pg
|
pg
|
||||||
poltergeist
|
poltergeist
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
recaptcha_public_key: <%= ENV["MADRID_RECAPTCHA_PUBLIC_KEY"] %>
|
recaptcha_public_key: <%= ENV["MADRID_RECAPTCHA_PUBLIC_KEY"] %>
|
||||||
recaptcha_private_key: <%= ENV["MADRID_RECAPTCHA_PRIVATE_KEY"] %>
|
recaptcha_private_key: <%= ENV["MADRID_RECAPTCHA_PRIVATE_KEY"] %>
|
||||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||||
|
twitter_key: <%= ENV["TWITTER_KEY"] %>
|
||||||
|
twitter_secret: <%= ENV["TWITTER_SECRET"] %>
|
||||||
server_name: <%= fetch(:server_name) %>
|
server_name: <%= fetch(:server_name) %>
|
||||||
|
|
||||||
|
|||||||
4
config/initializers/omniauth.rb
Normal file
4
config/initializers/omniauth.rb
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
|
provider :developer unless Rails.env.production?
|
||||||
|
provider :twitter, Rails.application.secrets.twitter_key, Rails.application.secrets.twitter_secret
|
||||||
|
end
|
||||||
@@ -14,12 +14,18 @@ default: &default
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
secret_key_base: 56792feef405a59b18ea7db57b4777e855103882b926413d4afdfb8c0ea8aa86ea6649da4e729c5f5ae324c0ab9338f789174cf48c544173bc18fdc3b14262e4
|
secret_key_base: 56792feef405a59b18ea7db57b4777e855103882b926413d4afdfb8c0ea8aa86ea6649da4e729c5f5ae324c0ab9338f789174cf48c544173bc18fdc3b14262e4
|
||||||
|
twitter_key: AAAA
|
||||||
|
twitter_secret: BBBB
|
||||||
<<: *default
|
<<: *default
|
||||||
|
|
||||||
test:
|
test:
|
||||||
secret_key_base: 4d5adf961ddd27aef19622d6c0b3234d555f9ee003f022b1f829c92bbe33aaee907be7feb67bd54c14a1a32512fa968565ad405971fbc41bd0797af73c26a796
|
secret_key_base: 4d5adf961ddd27aef19622d6c0b3234d555f9ee003f022b1f829c92bbe33aaee907be7feb67bd54c14a1a32512fa968565ad405971fbc41bd0797af73c26a796
|
||||||
|
twitter_key: AAAA
|
||||||
|
twitter_secret: BBBB
|
||||||
<<: *default
|
<<: *default
|
||||||
|
|
||||||
production:
|
production:
|
||||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||||
|
twitter_key: <%= ENV["TWITTER_KEY"] %>
|
||||||
|
twitter_secret: <%= ENV["TWITTER_SECRET"] %>
|
||||||
<<: *default
|
<<: *default
|
||||||
Reference in New Issue
Block a user