3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'app/controllers/devise_omniauth/users/omniauth_callbacks_controller.rb', line 3
def facebook
auth = DeviseOmniauth::Authentication.find_or_create_for_facebook_oauth(request.env["omniauth.auth"], current_user)
@user = auth.user
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect @user, :event => :authentication
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
|