class Users::OmniauthCallbacksController

Public Instance Methods

all() click to toggle source
# File lib/generators/polivalente/templates/omniauth_controller.rb, line 4
def all
  user_class = Polivalente.config.user_class.constantize

  raise request.env["omniauth.auth"].to_yaml

  user = user_class.from_omniauth(request.env["omniauth.auth"])

  if user.persisted?
    flash.notice = "Signed in!"
    sign_in_and_redirect user
  else
    session["devise.user_attributes"] = user.attributes
    redirect_to new_user_registration_url
  end
end
Also aliased as: github, twitter
failure() click to toggle source
# File lib/generators/polivalente/templates/omniauth_controller.rb, line 22
def failure
  redirect_to main_app.root_path
end
github()
Alias for: all
twitter()
Alias for: all