small session refactor
This commit is contained in:
parent
31b84fd770
commit
597342fe9d
1 changed files with 3 additions and 5 deletions
|
@ -44,14 +44,12 @@ class Users::SessionsController < Devise::SessionsController
|
||||||
def destroy
|
def destroy
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
connected_with_france_connect = current_user.loged_in_with_france_connect
|
connected_with_france_connect = current_user.loged_in_with_france_connect
|
||||||
current_user.update(loged_in_with_france_connect: '')
|
|
||||||
|
|
||||||
|
current_user.update(loged_in_with_france_connect: nil)
|
||||||
sign_out :user
|
sign_out :user
|
||||||
|
|
||||||
case connected_with_france_connect
|
if connected_with_france_connect == User.loged_in_with_france_connects.fetch(:particulier)
|
||||||
when User.loged_in_with_france_connects.fetch(:particulier)
|
return redirect_to FRANCE_CONNECT[:particulier][:logout_endpoint], allow_other_host: true
|
||||||
redirect_to FRANCE_CONNECT[:particulier][:logout_endpoint], allow_other_host: true
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue