Skip to content

Commit

Permalink
Use 'rerequest' on facebook's auth to deal with users not sharing email
Browse files Browse the repository at this point in the history
If the user tried to authenticate via Facebook and didn't share the email,
the login would fail and the user would have to sign in to Facebook and
remove the Mconf app to be able to try to login on Mconf again.

Now it will request users to share their email when they click in the
sign in button if they didn't share yet.
  • Loading branch information
daronco committed Mar 28, 2018
1 parent 14752be commit 8c599b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ MCONF_EMAIL_TRACK_CLICKED=true
# MCONF_REDIS_PORT='6379'
# MCONF_REDIS_DB='0'

# Omniauth for google and facebook need API keys.
# More instructions can be found on https://github.com/omniauth/omniauth/wiki/List-of-Strategies
# Then add the following:
# Omniauth authentication, more at https://github.com/omniauth/omniauth/wiki/List-of-Strategies
# Get the keys for Google at https://console.developers.google.com
# You must enable the "People API" and "Google+ API"
# MCONF_OMNIAUTH_GOOGLE_KEY='yourgooglekey'
# MCONF_OMNIAUTH_FACEBOOK_KEY='yourfacebookkey'
# MCONF_OMNIAUTH_GOOGLE_SECRET='yourgooglesecret'
# Get the keys for Facebook at
# * http://developers.facebook.com/docs/authentication
# * https://developers.facebook.com/apps
# MCONF_OMNIAUTH_FACEBOOK_KEY='yourfacebookkey'
# MCONF_OMNIAUTH_FACEBOOK_SECRET='yourfacebooksecret'

# Flag to use authentication on playback url
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
end

if Rails.application.config.omniauth_facebook_key.present? && Rails.application.config.omniauth_facebook_secret.present?
config.omniauth :facebook, Rails.application.config.omniauth_facebook_key, Rails.application.config.omniauth_facebook_secret, {}
config.omniauth :facebook, Rails.application.config.omniauth_facebook_key, Rails.application.config.omniauth_facebook_secret, auth_type: 'rerequest'
end

# ==> Warden configuration
Expand Down

0 comments on commit 8c599b3

Please sign in to comment.