Skip to content

Connexion: Nouveau parcours pour les candidats [GEN-2012]#5288

Merged
calummackervoy merged 4 commits intomasterfrom
calum/refonte-parcours-connexion
Jan 15, 2025
Merged

Connexion: Nouveau parcours pour les candidats [GEN-2012]#5288
calummackervoy merged 4 commits intomasterfrom
calum/refonte-parcours-connexion

Conversation

@calummackervoy
Copy link
Copy Markdown
Contributor

@calummackervoy calummackervoy commented Dec 18, 2024

🤔 Pourquoi ?

Nous rencontrons des difficultés avec les candidats qui sont plusieurs à se partager la même adresse email. Dans un nouveau parcours, l'utilisateur soumet son adresse mail avant d'être rédirigé à la mode de connexion associé à son compte. Les changements visuels correspondent à la maquette rattachée au ticket.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

💻 Captures d'écran

Screenshot 2024-12-18 at 10 03 28 Screenshot 2024-12-18 at 11 22 06 Screenshot 2024-12-18 at 10 13 04

@calummackervoy calummackervoy added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog. labels Dec 18, 2024
@calummackervoy calummackervoy self-assigned this Dec 18, 2024
@github-actions
Copy link
Copy Markdown

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@calummackervoy calummackervoy force-pushed the calum/refonte-parcours-connexion branch from 06b789a to 94fc5da Compare December 18, 2024 11:09
@calummackervoy calummackervoy marked this pull request as ready for review December 18, 2024 11:09
@calummackervoy
Copy link
Copy Markdown
Contributor Author

calummackervoy commented Dec 18, 2024

Un truc qui peut gêner les utilisateurs est q'une fois que l'utilisateur Django a soumis son adresse mail dans la formulaire :

Screenshot 2024-12-18 at 12 16 47

Ils devront la remettre sous la forme suivante :

Screenshot 2024-12-18 at 12 18 06

Vu qu'il y a des parcours (conflit de nom - date de naissance pendant l'inscription) qui rédirige l'utilisateur à cette vue où on ne veut pas divulguer l'adresse mail, je pense que c'est correct qu'on ne l'affiche pas dans la formulaire. Par contre, on pourrait resoudre ce problème avec un clé dans la session, ou avec JavaScript. Qu'est-ce que vous pensez ?

@tonial
Copy link
Copy Markdown
Contributor

tonial commented Dec 19, 2024

Tu pourrais juste le gérer avec un query params non ?

On pourrait éventuellement verrouiller le champs email quand il est pré-rempli pour forcer à retourner à la page précédente si on veut changer d'adresse email.
Mais en vrai ce n'est pas très gênant parce que si on fait une coquille et que quand on corrige sur la page suivante ça correspond à un compte France Connect, on va avoir une erreur.

@calummackervoy
Copy link
Copy Markdown
Contributor Author

calummackervoy commented Dec 19, 2024

@tonial le pb est qu'un utilisateur peut tomber sur cette page en cliquant sur un lien depuis une modale comme celui-ci :

390400270-55071839-16ec-430a-9bfb-dd5e0abe3c53

On ne veut pas que l'utilisateur peut déanonymiser l'email si on reçoit ?knowsEmail=true

Ce ne fait pas actuellement partie des dessins donc on pourrait décider de juste forcer l'utilisateur à remettre l'email sur le seconde écran, mais je me suis démandé s'il vaut l'utilisation d'un clé dans la session ou du JS ?

</p>
<p>
FranceConnect est la solution proposée par l’État pour sécuriser et simplifier la connexion à vos services en ligne.
</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai l'impression qu'une partie de mise à jour de wording (et d'image) pourrait facilement être sortie dans un commit séparé (voir même une PR ?) .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai choisis un commit séparé cette fois juste pour éviter déranger le métier / UX pendant leur relecture

self.fields["birthdate"].initial = prior_cleaned_data.get("birthdate")
self.fields["nir"].initial = prior_cleaned_data.get("nir")

# self.fields["password1"].help_text = CnilCompositionPasswordValidator().get_help_text()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@calummackervoy calummackervoy force-pushed the calum/refonte-parcours-connexion branch 2 times, most recently from 1a2afed to b0a55da Compare January 13, 2025 12:20
@calummackervoy calummackervoy force-pushed the calum/refonte-parcours-connexion branch from 5262266 to b30a7a3 Compare January 13, 2025 14:55
Copy link
Copy Markdown
Contributor

@tonial tonial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Désolé, j'avais complètement oublié de repasser sur ta PR.
C'est bon pour moi :)

return super().form_valid(form)

def get_success_url(self):
return f'{reverse("login:existing_user", args=(self.user.public_id,))}?back_url={reverse("login:job_seeker")}'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu pourrais faire ça ici :

Suggested change
return f'{reverse("login:existing_user", args=(self.user.public_id,))}?back_url={reverse("login:job_seeker")}'
return add_url_param(
reverse("login:existing_user", args=(self.user.public_id,)),
{
"back_url": reverse("login:job_seeker"),
"email": self.user.email,
},
)

Et dans ExistingUserLoginView tu peux récupérer le query params pour figer le formulaire si c'est bien l'email correspondant au public_id

Tu en penses quoi ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aime que c'est plus simple que l'utilisation de session et que le lien va marcher si l'utilisateur change son appareil, mais ça va d'envoyer l'adresse dans l'URL ?

J'imagine que la gagne n'est pas digne de l'effort, mais un attaquant pourrait utiliser le lien pour récuperer l'adresse email d'utilisateur.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On transmets bien l'email dans le query_params login_hint (c'est rendu possible dans la RFC)
Pour moi ce n'est pas un problème car cette url n'a pas vocation à être transmis à quelqu'un d'autre.

Après, ta solution avec la session marche bien, et est déjà codée donc c'est pas gênant (et il y a peu de chance que l'utilisateur change de navigateur en cours de route)

This template can optionally have the email of the user displayed, if it is safe to do so.
This is done using the session and comparing the stashed value to the user concerned by this view.
"""
stashed_email = self.request.session.get(ITOU_SESSION_JOB_SEEKER_LOGIN_EMAIL_KEY, None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@calummackervoy calummackervoy removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jan 15, 2025
@calummackervoy calummackervoy added this pull request to the merge queue Jan 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 15, 2025
Explanations for FranceConnect and France Travail Connect login methods
A new process in which the user submits their email address and is redirected to the correct login method instead of being depended on to choose which service they use to connect. Includes also a graphical redesign, and some redirection options to the registration process.
When the user proves knowledge of their email during the login flow, we store the email entered in the session so that we can pre-fill it for them on the subsequent password form. Not all flows leading to this view involve the user proving their email however, so if the key is not present in the session or it doesn't match the user's public id then it is ignored.
@calummackervoy calummackervoy force-pushed the calum/refonte-parcours-connexion branch from b30a7a3 to f1ee383 Compare January 15, 2025 10:25
@calummackervoy calummackervoy added this pull request to the merge queue Jan 15, 2025
Merged via the queue into master with commit 7231890 Jan 15, 2025
@calummackervoy calummackervoy deleted the calum/refonte-parcours-connexion branch January 15, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ajouté Ajouté dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants