add login_with_france_connect boolean at the FC connection

This commit is contained in:
Xavier J 2015-10-07 11:24:07 +02:00
parent 6db8efb078
commit 3d38f6fcdb
6 changed files with 57 additions and 37 deletions

View file

@ -1,5 +1,4 @@
#form_login{
text-align:center;
h4{
margin-top:11px;
}

View file

@ -23,6 +23,11 @@ class FranceConnectController < ApplicationController
sign_in @user
if current_user == @user
@user.login_with_france_connect = true
@user.save
end
redirect_to(controller: 'users/dossiers', action: :index)
end
rescue Rack::OAuth2::Client::Error => e

View file

@ -1,30 +1,30 @@
#div{style:'text-align:center'}
%div{style:'text-align:center'}
%h2#login_user Connexion
%br
%div#form_login.row
%div.col-md-6.col-lg-6
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
%h4
= f.label :email
= f.email_field :email, autofocus: true, class: 'form-control'
%br
%h4
= f.label :password
= f.password_field :password, autocomplete: "off", class: 'form-control'
%br
/ - if devise_mapping.rememberable?
/ .field
/ = f.check_box :remember_me
/ = f.label :remember_me
.actions
= f.submit "Se connecter", class:'btn btn-primary btn-lg'
%br
%br
%div#form_login.row
%div.col-md-6.col-lg-6
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
%h4
= f.label :email
= f.email_field :email, autofocus: true, class: 'form-control'
%br
%h4
= f.label :password
= f.password_field :password, autocomplete: "off", class: 'form-control'
%br
/ - if devise_mapping.rememberable?
/ .field
/ = f.check_box :remember_me
/ = f.label :remember_me
.actions
= f.submit "Se connecter", class:'btn btn-primary btn-lg'
%br
= render "users/shared/links"
= render "users/shared/links"
%div.col-md-6.col-lg-6.border-left
%img#logo_fc{src: '/assets/logo_FC_03.png', style:'max-height:180px'}
%br
%button.btn.btn-info.btn-lg
= link_to "Se connecter", '/france_connect', id: 'france_connect', style:'color:white; text-decoration: none'
%div.col-md-6.col-lg-6.border-left
%img#logo_fc{src: '/assets/logo_FC_03.png', style:'max-height:180px'}
%br
%button.btn.btn-info.btn-lg
= link_to "Connexion", '/france_connect', id: 'france_connect', style:'color:white; text-decoration: none'