Skip to content

Commit 1c63c1b

Browse files
Merge branch 'master' into fix/data-export
2 parents 6275727 + 43827c8 commit 1c63c1b

9 files changed

Lines changed: 27 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# [3.16.0](https://github.com/SocialGouv/egapro/compare/v3.15.3...v3.16.0) (2026-03-09)
2+
3+
4+
### Bug Fixes
5+
6+
* publication year data ([#2890](https://github.com/SocialGouv/egapro/issues/2890)) ([9af0d37](https://github.com/SocialGouv/egapro/commit/9af0d37f367bbd3884aa7a14c4d430eedae03a5e))
7+
* session error ([#2911](https://github.com/SocialGouv/egapro/issues/2911)) ([b6b4976](https://github.com/SocialGouv/egapro/commit/b6b497660ed023f68e615dfadd5bfd94ec7c3ff2))
8+
9+
10+
### Features
11+
12+
* public year 2025 ([#2951](https://github.com/SocialGouv/egapro/issues/2951)) ([3926ae0](https://github.com/SocialGouv/egapro/commit/3926ae0dce6c4fdb8f367e12cc72b563123b750f))
13+
114
## [3.15.3](https://github.com/SocialGouv/egapro/compare/v3.15.2...v3.15.3) (2026-03-02)
215

316

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "~egapro-dev",
3-
"version": "3.15.3",
3+
"version": "3.16.0",
44
"private": true,
55
"engines": {
66
"node": "20"

packages/api/egapro/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
# Always let the comment for us to switch between enabled read current year or not
1515
# PUBLIC_YEARS = YEARS
16-
PUBLIC_YEARS = [2018, 2019, 2020, 2021, 2022, 2023, 2024]
16+
PUBLIC_YEARS = [2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025]
1717
# PUBLIC_YEARS_REPEQ = YEARS_REPEQ
18-
PUBLIC_YEARS_REPEQ = [2021, 2022, 2023, 2024]
18+
PUBLIC_YEARS_REPEQ = [2021, 2022, 2023, 2024, 2025]
1919

2020
REGIONS = {
2121
"01": "Guadeloupe",

packages/app/src/api/core-domain/infra/auth/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ export const authConfig: AuthOptions = {
295295
async session({ session, token }) {
296296
session.user = JSON.parse(JSON.stringify(token.user)); // very important ! to avoid token mutation. Else the companies are added to the token and the headers will too big & rejected by nginx
297297
session.user.email = token.email;
298+
session.user.companies = []; // Default to empty array to prevent TypeError if Redis load fails
298299
session.staff = {};
299300

300301
// Load companies from Redis using the hash if it exists
@@ -314,7 +315,7 @@ export const authConfig: AuthOptions = {
314315
}
315316
}
316317

317-
if (token.user.staff || token.staff.impersonating) {
318+
if (token.user.staff || token.staff?.impersonating) {
318319
session.staff = token.staff;
319320

320321
// Load last impersonated companies if hash exists

packages/app/src/app/(default)/index-egapro/declaration/commencer/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fr } from "@codegouvfr/react-dsfr";
33
import Alert from "@codegouvfr/react-dsfr/Alert";
44
import { config } from "@common/config";
55
import Link from "next/link";
6+
import { redirect } from "next/navigation";
67
import { getServerSession } from "next-auth";
78

89
import { type FunnelKey, funnelStaticConfig } from "../declarationFunnelConfiguration";
@@ -24,7 +25,7 @@ const proconnectManageOrganisationsUrl = config.proconnect.manageOrganisationUrl
2425

2526
const CommencerPage = async () => {
2627
const session = await getServerSession(authConfig);
27-
if (!session) return null;
28+
if (!session) redirect("/login");
2829
const isEmailLogin = config.api.security.auth.isEmailLogin;
2930

3031
if (!session.user.companies.length && !session.user.staff) {

packages/app/src/app/(default)/index-egapro/declaration/declarant/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fr } from "@codegouvfr/react-dsfr";
33
import Alert from "@codegouvfr/react-dsfr/Alert";
44
// import { config } from "@common/config";
55
import Link from "next/link";
6+
import { redirect } from "next/navigation";
67
import { getServerSession } from "next-auth";
78

89
import { AlertExistingDeclaration } from "../AlertExistingDeclaration";
@@ -16,7 +17,7 @@ const proconnectPersonalInformationUrl = process.env.EGAPRO_PROCONNECT_PERSONAL_
1617

1718
const DeclarantPage = async () => {
1819
const session = await getServerSession(authConfig);
19-
if (!session) return null;
20+
if (!session) redirect("/login");
2021

2122
return (
2223
<>

packages/app/src/app/(default)/representation-equilibree/(funnel)/commencer/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fr } from "@codegouvfr/react-dsfr";
33
import Alert from "@codegouvfr/react-dsfr/Alert";
44
import { config } from "@common/config";
55
import Link from "next/link";
6+
import { redirect } from "next/navigation";
67
import { getServerSession } from "next-auth";
78

89
import { TITLES } from "../titles";
@@ -21,7 +22,7 @@ const proconnectManageOrganisationsUrl = config.proconnect.manageOrganisationUrl
2122

2223
const CommencerPage = async () => {
2324
const session = await getServerSession(authConfig);
24-
if (!session) return null;
25+
if (!session) redirect("/login");
2526
const isEmailLogin = config.api.security.auth.isEmailLogin;
2627

2728
if (!(session.user.staff || session.user.companies.length)) {

packages/app/src/app/(default)/representation-equilibree/(funnel)/declarant/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { authConfig } from "@api/core-domain/infra/auth/config";
22
import { fr } from "@codegouvfr/react-dsfr";
33
import Alert from "@codegouvfr/react-dsfr/Alert";
44
import { Link } from "@design-system";
5+
import { redirect } from "next/navigation";
56
import { getServerSession } from "next-auth";
67

78
import { TITLES } from "../titles";
@@ -20,7 +21,7 @@ const proconnectPersonalInformationUrl = process.env.EGAPRO_PROCONNECT_PERSONAL_
2021

2122
const DeclarantPage = async () => {
2223
const session = await getServerSession(authConfig);
23-
if (!session) return null;
24+
if (!session) redirect("/login");
2425

2526
return (
2627
<>

packages/app/src/common/dict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const OPMC_OPEN_DURATION_AFTER_EDIT = 2;
2222
/** Need to be set manually because declaration are not opened on Jan 1rst */
2323
export const CURRENT_YEAR = 2025 as const;
2424
/** Need to be set */
25-
export const PUBLIC_CURRENT_YEAR = 2024;
25+
export const PUBLIC_CURRENT_YEAR = 2025;
2626
export const ALL_YEARS = times(CURRENT_YEAR - FIRST_YEAR + 1, idx => FIRST_YEAR + idx);
2727
export const YEARS = times(CURRENT_YEAR - FIRST_DECLARATION_YEAR + 1, idx => FIRST_DECLARATION_YEAR + idx);
2828
export const ADMIN_YEARS = times(CURRENT_YEAR - FIRST_YEAR + 1, idx => FIRST_YEAR + idx);

0 commit comments

Comments
 (0)