Merge branch 'france_connect' of ssh://37.187.249.111:2200/opt/git/tps into france_connect

Conflicts:
	spec/controllers/france_connect_controller_spec.rb
This commit is contained in:
Tanguy PATTE 2015-10-07 16:50:52 +02:00
commit deb13673d7
5 changed files with 81 additions and 17 deletions

View file

@ -6,15 +6,30 @@ class Users::SessionsController < Devise::SessionsController
# super
# end
# POST /resource/sign_in
# def create
# super
# end
#POST /resource/sign_in
def create
super
current_user.update_attributes(login_with_france_connect: false)
end
# DELETE /resource/sign_out
# def destroy
# super
# end
def destroy
connected_with_france_connect = current_user.login_with_france_connect
current_user.update_attributes(login_with_france_connect: false)
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
set_flash_message :notice, :signed_out if signed_out && is_flashing_format?
yield if block_given?
if connected_with_france_connect
redirect_to FRANCE_CONNECT.logout_endpoint
else
respond_to_on_destroy
end
end
# protected