[#915] Revu de code Ok
This commit is contained in:
parent
a828c6259b
commit
728150b148
9 changed files with 33 additions and 32 deletions
|
@ -23,13 +23,10 @@ class FranceConnectController < ApplicationController
|
|||
|
||||
sign_in @user
|
||||
|
||||
if current_user == @user
|
||||
@user.login_with_france_connect = true
|
||||
@user.save
|
||||
end
|
||||
@user.loged_in_with_france_connect = true
|
||||
@user.save
|
||||
|
||||
redirect_to stored_location_for(current_user) || signed_in_root_path(current_user)
|
||||
|
||||
end
|
||||
rescue Rack::OAuth2::Client::Error => e
|
||||
Rails.logger.error e.message
|
||||
|
|
|
@ -10,13 +10,13 @@ class Users::SessionsController < Devise::SessionsController
|
|||
def create
|
||||
super
|
||||
|
||||
current_user.update_attributes(login_with_france_connect: false)
|
||||
current_user.update_attributes(loged_in_with_france_connect: false)
|
||||
end
|
||||
|
||||
# DELETE /resource/sign_out
|
||||
def destroy
|
||||
connected_with_france_connect = current_user.login_with_france_connect
|
||||
current_user.update_attributes(login_with_france_connect: false)
|
||||
connected_with_france_connect = current_user.loged_in_with_france_connect
|
||||
current_user.update_attributes(loged_in_with_france_connect: false)
|
||||
|
||||
|
||||
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
%div{style:'margin-left:35px'}
|
||||
S'identifier avec
|
||||
France Connect
|
||||
|
||||
|
||||
%hr
|
||||
|
||||
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue