Class: Users::OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
app/controllers/users/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#amazonObject



18
19
20
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 18

def amazon
   'Amazon'
end

#failureObject



26
27
28
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 26

def failure
  redirect_to root_path
end

#githubObject



22
23
24
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 22

def github
   'Github'
end

#google_oauth2Object



14
15
16
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 14

def google_oauth2
   'Google'
end

#launchpadObject

Workaround for github.com/plataformatec/devise/issues/2432 skip_before_filter :verify_authenticity_token



6
7
8
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 6

def launchpad
   'Launchpad'
end

#login_via(provider_name) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 30

def (provider_name)
  # TODO: log

  # You need to implement the method below in your model (e.g. app/models/user.rb)
  @user = User.from_omniauth(request.env["omniauth.auth"])

  # Has the user uploaded screenshots while not being logged in?
  # Move the screenshots to the real account and tell the user.
  if @user.persisted?
    flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => provider_name
     @user, :event => :authentication
  else
    redirect_to new_user_session_url, alert: @user.errors.full_messages.join("\n")
  end
end

#stackexchangeObject



10
11
12
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 10

def stackexchange
   'StackExchange'
end