README.md in omniauth-google-oauth2-0.5.3 vs README.md in omniauth-google-oauth2-0.5.4
- old
+ new
@@ -93,12 +93,11 @@
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'],
{
- name: 'google',
- scope: 'email, profile, plus.me, http://gdata.youtube.com',
+ scope: 'userinfo.email, userinfo.profile, plus.me, http://gdata.youtube.com',
prompt: 'select_account',
image_aspect_ratio: 'square',
image_size: 50
}
end
@@ -166,10 +165,11 @@
Configuration options can be passed as the last parameter here as key/value pairs.
```ruby
config.omniauth :google_oauth2, 'GOOGLE_CLIENT_ID', 'GOOGLE_CLIENT_SECRET', {}
```
+NOTE: If you are using this gem with devise with above snippet in `config/initializers/devise.rb` then do not create `config/initializers/omniauth.rb` which will conflict with devise configurations.
Then add the following to 'config/routes.rb' so the callback routes are defined.
```ruby
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
@@ -301,10 +301,10 @@
## Fixing Protocol Mismatch for `redirect_uri` in Rails
Just set the `full_host` in OmniAuth based on the Rails.env.
```
-# config/initialisers/omniauth.rb
+# config/initializers/omniauth.rb
OmniAuth.config.full_host = Rails.env.production? ? 'https://domain.com' : 'http://localhost:3000'
```
## License