Skip to content

feat: new login page#120

Merged
desoindx merged 1 commit intodevelopfrom
feat/new-login
Feb 25, 2026
Merged

feat: new login page#120
desoindx merged 1 commit intodevelopfrom
feat/new-login

Conversation

@desoindx
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 20, 2026 14:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the login experience to support a new UI flow around ProConnect vs. “classic” credentials login, and adds analytics tracking around login actions.

Changes:

  • Adjusts credentials authorization to emit a special error when the user has no credentials password (intended to redirect users to ProConnect).
  • Redesigns the login UI into a ProConnect block + DSFR Tabs for “Créer un accès” and “Connexion”, with Matomo tracking.
  • Updates the login CSS module to match the new layout (new .description, updated .box / .button styles).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/services/auth/config.ts Changes credentials auth error behavior (introduces "proconnect" error)
src/components/Login/LoginForm.tsx New login page UI with tabs, error handling, and Matomo tracking
src/components/Login/LoginForm.module.css Styles updated for the redesigned login layout

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

className='fr-mt-4w'
title={
error === "proconnect"
? "Vous essayez de vous connecter avec un compte ProConnect, veuillez utiliser le bouton de connexion ProConnect ci dessus."
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Spelling/typography in the user-facing message: "ci dessus" should be hyphenated as "ci-dessus".

Suggested change
? "Vous essayez de vous connecter avec un compte ProConnect, veuillez utiliser le bouton de connexion ProConnect ci dessus."
? "Vous essayez de vous connecter avec un compte ProConnect, veuillez utiliser le bouton de connexion ProConnect ci-dessus."

Copilot uses AI. Check for mistakes.
const account = user.accounts.find((account) => account.provider === "credentials")
if (!account || !account.password) {
throw new Error("Invalid crendentials")
throw new Error("proconnect")
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The credentials provider now returns a distinct error ("proconnect") when a user exists but has no credentials password. This makes the login response differ based on whether the email exists / which auth method the account uses, enabling account enumeration. Consider returning the same generic error for all credential failures (including missing credentials account), and handle the UX hint ("try ProConnect") without relying on a server-side distinguishable error code.

Suggested change
throw new Error("proconnect")
throw new Error("Invalid crendentials")

Copilot uses AI. Check for mistakes.
Comment on lines 57 to 58
throw new Error("Invalid crendentials")
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Spelling: "Invalid crendentials" is misspelled in this thrown error message; it should be "Invalid credentials".

Copilot uses AI. Check for mistakes.
tabs={[
{
label: "Créer un accès",
isDefault: true,
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The credentials login form is now inside the "Connexion" tab, but the default tab is set to "Créer un accès". This will break the existing Playwright helper loginWithPassword (it expects the Email/Mot de passe fields to be visible immediately on /login). Either make the "Connexion" tab the default or update the e2e tests to select the tab before filling the form.

Suggested change
isDefault: true,

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +43
if (result.error === "proconnect") {
track("Login", "Credentials", "Error ProConnect")
} else {
track("Login", "Credentials", "Error")
}
setError(result.error)
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The "proconnect" error code is duplicated as a raw string in multiple places (comparison + backend throw). To avoid drift and make refactors safer, consider centralizing it in a shared constant (e.g., an exported error code enum/module) used by both the auth layer and UI.

Copilot uses AI. Check for mistakes.
@desoindx desoindx merged commit a3b7132 into develop Feb 25, 2026
5 of 6 checks passed
@desoindx desoindx deleted the feat/new-login branch February 25, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants