[bis] force login_with_france_connect at false when connection devise user

This commit is contained in:
Xavier J 2015-10-07 14:19:16 +02:00
parent 35ef473f59
commit 9c6b9d408b
4 changed files with 11 additions and 14 deletions

View file

@ -6,10 +6,13 @@ class Users::SessionsController < Devise::SessionsController
# super # super
# end # end
# POST /resource/sign_in #POST /resource/sign_in
# def create def create
# super super
# end
current_user.login_with_france_connect = false
current_user.save
end
# DELETE /resource/sign_out # DELETE /resource/sign_out
# def destroy # def destroy

View file

@ -1,21 +1,17 @@
Rails.application.routes.draw do Rails.application.routes.draw do
devise_for :users, controllers: { devise_for :users, controllers: {
sessions: 'users/sessions' sessions: 'users/sessions'
} }
devise_for :gestionnaires, controllers: { devise_for :gestionnaires, controllers: {
sessions: 'gestionnaires/sessions' sessions: 'gestionnaires/sessions'
}, skip: [:password, :registrations] }, skip: [:password, :registrations]
root 'users/dossiers#index' 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 namespace :users do
get 'siret' => 'siret#index' get 'siret' => 'siret#index'

View file

@ -35,7 +35,6 @@ describe FranceConnectController, type: :controller do
end end
it 'redirect to dossiers list' do it 'redirect to dossiers list' do
get :callback, code: code
expect(response).to redirect_to(controller: 'users/dossiers', action: :index) expect(response).to redirect_to(controller: 'users/dossiers', action: :index)
end end
end end

View file

@ -1,7 +1,6 @@
require 'spec_helper' require 'spec_helper'
describe FranceConnectService do describe FranceConnectService do
describe '.retrieve_user_informations' do describe '.retrieve_user_informations' do
let(:code) { 'plop' } let(:code) { 'plop' }