fix: verified_email from FC

This commit is contained in:
simon lehericey 2024-11-22 15:19:47 +01:00
parent 08083f8feb
commit 5edd54b598
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
5 changed files with 4 additions and 28 deletions

View file

@ -59,12 +59,11 @@ class FranceConnect::ParticulierController < ApplicationController
def merge_using_fc_email
@fci.safely_associate_user!(@fci.email_france_connect)
@fci.user.update!(email_verified_at: Time.current)
sign_in(@fci.user)
@fci.send_custom_confirmation_instructions
render :confirmation_sent, locals: { email: @fci.email_france_connect, destination_path: destination_path(@fci.user) }
redirect_to destination_path(@fci.user), notice: t('france_connect.particulier.flash.connection_done', application_name: Current.application_name)
end
def merge_using_password

View file

@ -1,12 +0,0 @@
.fr-container
.fr-col-12.fr-col-md-6.fr-col-offset-md-3
%h1.fr-mt-6w.fr-h2.center= t('.confirmation_sent_by_email')
%p.center= image_tag("user/confirmation-email.svg", alt: '')
= render Dsfr::AlertComponent.new(title: '', state: :info, heading_level: 'h2', extra_class_names: 'fr-mt-6w fr-mb-3w') do |c|
- c.with_body do
%p= t('.intro_html', email: h(email)).html_safe
%p= t('.click_the_link_in_the_email')
%p.center= link_to t('.continue'), destination_path, class: 'fr-btn'

View file

@ -888,11 +888,6 @@ en:
alternative_email: "Please provide the email to use for contacting you."
keep_fc_email_html: Yes, use <b class='bold'>%{email}</b> as contact email.
use_another_email: No, use another address.
confirmation_sent:
confirmation_sent_by_email: "Confirm your email"
intro_html: "A confirmation email has been sent to your address <span class='fr-badge fr-badge--info fr-badge--no-icon fr-badge--lowercase'>%{email}</span>"
click_the_link_in_the_email: "Please click the link in the email to confirm your account and connect with France Connect in the future."
continue: "Continue"
merge:
title: "Merge your account FranceConnect and %{application_name}"
subtitle_html: "Hello,<br /><br />Your account FranceConnect uses <b class='bold'>%{email}</b> as contact email.<br />But there is an existing %{application_name} account using this email."

View file

@ -942,11 +942,6 @@ fr:
use_another_email: Non, utiliser une autre adresse
email_suggest:
wanna_say: 'Voulez-vous dire ?'
confirmation_sent:
confirmation_sent_by_email: Confirmez votre email
intro_html: "Un mail de confirmation a été envoyé à votre adresse <span class='fr-badge fr-badge--info fr-badge--no-icon fr-badge--lowercase'>%{email}</span>"
click_the_link_in_the_email: Vous devez impérativement cliquer sur le lien du mail pour activer votre adresse et recevoir les notifications sur lavancement de vos dossiers.
continue: Continuer
merge:
title: "Fusion des comptes FranceConnect et %{application_name}"
subtitle_html: "Bonjour,<br /><br />Votre compte FranceConnect utilise <b class='bold'>%{email}</b> comme email de contact.<br />Or il existe un compte sur %{application_name} avec cet email."

View file

@ -155,10 +155,9 @@ describe FranceConnect::ParticulierController, type: :controller do
user = User.last
expect(user.email).to eq(email.downcase)
expect(UserMailer).to have_received(:custom_confirmation_instructions).with(user, user.confirmation_token)
expect(user.email_verified_at).to be_nil
expect(user.email_verified_at).not_to be_nil
expect(fci.reload.merge_token).to be_nil
expect(response).to render_template(:confirmation_sent)
expect(response).to redirect_to(root_path(user))
end
end