2015-12-09 15:10:11 +01:00
|
|
|
class Sessions::SessionsController < Devise::SessionsController
|
|
|
|
before_action :before_sign_in, only: [:create]
|
|
|
|
|
2019-01-08 08:20:49 +01:00
|
|
|
layout 'new_application'
|
|
|
|
|
2015-12-09 15:10:11 +01:00
|
|
|
def before_sign_in
|
2018-10-01 13:24:37 +02:00
|
|
|
if user_signed_in?
|
|
|
|
sign_out :user
|
|
|
|
end
|
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
if instructeur_signed_in?
|
|
|
|
sign_out :instructeur
|
2018-10-01 13:24:37 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if administrateur_signed_in?
|
|
|
|
sign_out :administrateur
|
|
|
|
end
|
|
|
|
|
|
|
|
if administration_signed_in?
|
|
|
|
sign_out :administration
|
|
|
|
end
|
2015-12-09 15:10:11 +01:00
|
|
|
end
|
|
|
|
end
|