3dbdc9ac11
downgraded rake to 0.8.7
32 lines
1.1 KiB
Ruby
32 lines
1.1 KiB
Ruby
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|
|
|
def facebook
|
|
# You need to implement the method below in your model
|
|
@user = User.find_for_facebook_oauth(env["omniauth.auth"], current_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"] = env["omniauth.auth"]
|
|
redirect_to new_user_registration_url
|
|
end
|
|
end
|
|
|
|
def open_id
|
|
# You need to implement the method below in your model
|
|
@user = User.find_for_open_id(env["omniauth.auth"], current_user)
|
|
if @user.persisted?
|
|
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Google"
|
|
sign_in_and_redirect @user, :event => :authentication
|
|
else
|
|
session["devise.open:id_data"] = env["openid.ext1"]
|
|
redirect_to new_user_registration_url
|
|
end
|
|
end
|
|
|
|
def passthru
|
|
render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
|
|
end
|
|
|
|
end |