2017-12-20 15:27:33 +01:00
|
|
|
class Administrations::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|
|
|
def github
|
|
|
|
administration = Administration.from_omniauth(request.env["omniauth.auth"])
|
|
|
|
if administration.present?
|
|
|
|
sign_in administration
|
2018-01-16 17:24:09 +01:00
|
|
|
redirect_to manager_administrateurs_path
|
2017-12-20 15:27:33 +01:00
|
|
|
else
|
|
|
|
flash[:alert] = "Compte GitHub non autorisé"
|
|
|
|
redirect_to root_path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def failure
|
|
|
|
redirect_to root_path
|
|
|
|
end
|
|
|
|
end
|