Skip to content

Commit

Permalink
https://github.com/heartcombo/devise/issues/5236#issuecomment-766458987
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmeriftw committed Jun 1, 2021
1 parent eac4795 commit 7eb4338
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gem 'fog-aws'
gem 'mailjet'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-rails_csrf_protection'
gem 'pg'
gem 'puma'
gem 'pundit'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ GEM
omniauth-oauth2 (1.7.1)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-rails_csrf_protection (1.0.0)
actionpack (>= 4.2)
omniauth (~> 2.0)
orm_adapter (0.5.0)
pg (1.2.3)
pry (0.14.1)
Expand Down Expand Up @@ -376,6 +379,7 @@ DEPENDENCIES
mailjet
omniauth
omniauth-facebook
omniauth-rails_csrf_protection
pg
pry-rails
puma
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
@user = User.find_for_facebook_oauth(request.env['omniauth.auth'])
@user = User.find_for_facebook(request.env['omniauth.auth'])

if @user.persisted?
flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: 'Facebook')
Expand Down
3 changes: 2 additions & 1 deletion app/views/devise/shared/_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider),
method: :post %><br />
<% end %>
<% end %>

0 comments on commit 7eb4338

Please sign in to comment.