Skip to content

Transitions to using google_oauth for omniauth #9

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ pickle-email-*.html

# tilde files are usually backup files from a text editor
*~

# Ignore application configuration
/config/application.yml
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
source 'https://rubygems.org'
ruby '2.3.1'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'sqlite3'
gem 'pg'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'figaro'
group :development, :test do
gem 'byebug', platform: :mri
end
Expand All @@ -22,7 +23,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'bootstrap-sass'
gem 'high_voltage'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-google-oauth2'
group :development do
gem 'better_errors'
gem 'rails_layout'
Expand Down
38 changes: 26 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ GEM
railties (>= 3.0.0)
faker (1.6.6)
i18n (~> 0.5)
faraday (0.10.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
figaro (1.1.1)
thor (~> 0.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
hashie (3.4.6)
Expand All @@ -94,7 +98,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.6)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.0.8)
Expand All @@ -111,19 +115,29 @@ GEM
mini_portile2 (2.1.0)
minitest (5.9.1)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nio4r (1.2.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
oauth (0.5.1)
oauth2 (1.3.0)
faraday (>= 0.8, < 0.11)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-twitter (1.2.1)
json (~> 1.3)
omniauth-oauth (~> 1.1)
omniauth-google-oauth2 (0.4.1)
jwt (~> 1.5.2)
multi_json (~> 1.3)
omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.3.1)
omniauth-oauth2 (1.4.0)
oauth2 (~> 1.0)
omniauth (~> 1.2)
pg (0.18.4)
puma (3.6.0)
rack (2.0.1)
rack-test (0.6.3)
Expand Down Expand Up @@ -199,7 +213,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.12)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
Expand Down Expand Up @@ -234,13 +247,15 @@ DEPENDENCIES
database_cleaner
factory_girl_rails
faker
figaro
high_voltage
jbuilder (~> 2.5)
jquery-rails
launchy
listen (~> 3.0.5)
omniauth
omniauth-twitter
omniauth-google-oauth2
pg
puma (~> 3.0)
rails (~> 5.0.0, >= 5.0.0.1)
rails_layout
Expand All @@ -250,7 +265,6 @@ DEPENDENCIES
spring
spring-commands-rspec
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
Expand All @@ -260,4 +274,4 @@ RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.13.2
1.13.6
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class SessionsController < ApplicationController

def new
redirect_to '/auth/twitter'
redirect_to '/auth/google_oauth2'
end

def create
Expand Down
13 changes: 13 additions & 0 deletions config/application.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Add configuration values here, as shown below.
#
# pusher_app_id: "2954"
# pusher_key: 7381a978f7dd7f9a1117
# pusher_secret: abdc3b896a0ffb85d373
# stripe_api_key: sk_test_2J0l093xOyW72XUYJHE4Dv2r
# stripe_publishable_key: pk_test_ro9jV5SNwGb1yYlQfzG17LHK
#
# production:
# stripe_api_key: sk_live_EeHnL644i6zo4Iyq4v1KdV9H
# stripe_publishable_key: pk_live_9lcthxpSIHbGwmdO941O1XVU
OMNIAUTH_PROVIDER_KEY: 479865327991-biejutibb4dg5179pmief0q1t6v5sj1n.apps.googleusercontent.com
OMNIAUTH_PROVIDER_SECRET: 6kTEdPgcigwrP4Ljs8E6QfjV
2 changes: 1 addition & 1 deletion config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, Rails.application.secrets.omniauth_provider_key, Rails.application.secrets.omniauth_provider_secret
provider :google_oauth2, Rails.application.secrets.omniauth_provider_key, Rails.application.secrets.omniauth_provider_secret
end