diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 45bf9e8e2..9f11fb263 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -6,10 +6,13 @@ class Users::SessionsController < Devise::SessionsController # super # end - # POST /resource/sign_in - # def create - # super - # end + #POST /resource/sign_in + def create + super + + current_user.login_with_france_connect = false + current_user.save + end # DELETE /resource/sign_out # def destroy diff --git a/config/routes.rb b/config/routes.rb index 4c217e530..b61d07576 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,21 +1,17 @@ Rails.application.routes.draw do devise_for :users, controllers: { - sessions: 'users/sessions' - } + sessions: 'users/sessions' + } devise_for :gestionnaires, controllers: { sessions: 'gestionnaires/sessions' }, skip: [:password, :registrations] - root 'users/dossiers#index' - # root 'users/france_connect_callbacks#login' - - - get 'france_connect' => 'france_connect#login' - get 'france_connect/callback' => 'france_connect#callback' + get 'france_connect' => 'france_connect#login' + get 'france_connect/callback' => 'france_connect#callback' namespace :users do get 'siret' => 'siret#index' diff --git a/spec/controllers/france_connect_controller_spec.rb b/spec/controllers/france_connect_controller_spec.rb index 38859dff8..b22133ad9 100644 --- a/spec/controllers/france_connect_controller_spec.rb +++ b/spec/controllers/france_connect_controller_spec.rb @@ -35,7 +35,6 @@ describe FranceConnectController, type: :controller do end it 'redirect to dossiers list' do - get :callback, code: code expect(response).to redirect_to(controller: 'users/dossiers', action: :index) end end diff --git a/spec/services/france_connect_service_spec.rb b/spec/services/france_connect_service_spec.rb index 0a4412bc2..25753fa96 100644 --- a/spec/services/france_connect_service_spec.rb +++ b/spec/services/france_connect_service_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe FranceConnectService do - describe '.retrieve_user_informations' do let(:code) { 'plop' }