Skip to content

feat: disable proconnect connexion for communes#49

Merged
MaGOs92 merged 1 commit into
masterfrom
gfay_feat_disable-proconnect-for-communes
Apr 23, 2026
Merged

feat: disable proconnect connexion for communes#49
MaGOs92 merged 1 commit into
masterfrom
gfay_feat_disable-proconnect-for-communes

Conversation

@MaGOs92

@MaGOs92 MaGOs92 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

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.

Pull request overview

This PR prevents ProConnect authentication for organizations identified as communes (mairies), and surfaces a structured error to the frontend including a link to Mes Adresses.

Changes:

  • Extend INSEE org lookup to detect communes (legal category 7210) and return codeCommune.
  • Block ProConnect callback for communes with a FORBIDDEN error that includes a Mes Adresses redirect link.
  • Update controller redirect logic and integration tests to accommodate new error shapes/messages.

Reviewed changes

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

File Description
src/tests/proconnect.spec.ts Updates existing integration tests and adds coverage for commune rejection (with Mes Adresses link).
src/modules/proconnect/proconnect.service.ts Adds commune blocking logic and switches some errors to structured HttpException payloads.
src/modules/proconnect/proconnect.controller.ts Redirects FORBIDDEN errors to frontend with error/errorLink query params.
src/modules/proconnect/insee.service.ts Adds isCommune + codeCommune inference from INSEE response.

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

Comment thread src/modules/proconnect/proconnect.service.ts
Comment thread src/modules/proconnect/proconnect.controller.ts
Comment thread src/modules/proconnect/proconnect.controller.ts
@MaGOs92 MaGOs92 merged commit 796a2c1 into master Apr 23, 2026
7 checks passed
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