Github SSO added
This commit is contained in:
parent
65723d3063
commit
b24abd7328
6 changed files with 23 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue