[Fix #1096] Github Oauth
This commit is contained in:
parent
46b14e97ed
commit
7c0fdbc9f8
7 changed files with 68 additions and 3 deletions
|
@ -0,0 +1,16 @@
|
|||
class Administrations::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
def github
|
||||
administration = Administration.from_omniauth(request.env["omniauth.auth"])
|
||||
if administration.present?
|
||||
sign_in administration
|
||||
redirect_to administrations_path
|
||||
else
|
||||
flash[:alert] = "Compte GitHub non autorisé"
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
def failure
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue