Github SSO added

This commit is contained in:
Christoph Haas 2017-04-19 00:15:29 +02:00
parent 65723d3063
commit b24abd7328
6 changed files with 23 additions and 8 deletions

View file

@ -19,7 +19,17 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
login_via 'Amazon'
end
def github
login_via 'Github'
end
def failure
redirect_to root_path
end
def login_via(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"])
@ -31,8 +41,4 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
end
def failure
redirect_to root_path
end
end