Skip to content

Commit 0d0f024

Browse files
authored
Merge pull request #94 from MyElectricalData/develop
Develop
2 parents fe19878 + a0876d7 commit 0d0f024

File tree

10 files changed

+37
-9
lines changed

10 files changed

+37
-9
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [1.5.0-dev.1](https://github.com/MyElectricalData/myelectricaldata_new/compare/1.4.1...1.5.0-dev.1) (2025-12-21)
4+
5+
### Features
6+
7+
* **helm:** add Slack notification configuration ([e1570ad](https://github.com/MyElectricalData/myelectricaldata_new/commit/e1570ad296c8472a492fa1fc389948ddb306bde7))
8+
9+
### Bug Fixes
10+
11+
* **api:** disable redirect_slashes to fix Vite proxy routing ([7fbb6e0](https://github.com/MyElectricalData/myelectricaldata_new/commit/7fbb6e07812af81d3874385c0b03f60b69431df3))
12+
* **auth:** preserve query params in OAuth callback redirect ([c0b51c0](https://github.com/MyElectricalData/myelectricaldata_new/commit/c0b51c02a6e083c141afde7fad00e3f72d899fb5))
13+
314
## [1.4.1](https://github.com/MyElectricalData/myelectricaldata_new/compare/1.4.0...1.4.1) (2025-12-21)
415

516
### Bug Fixes

apps/api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "myelectricaldata-api"
3-
version = "1.4.1"
3+
version = "1.5.0-dev.1"
44
description = "MyElectricalData API Gateway for Enedis data"
55
authors = [{name = "m4dm4rtig4n"}]
66
license = {text = "Apache-2.0"}

apps/api/src/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ def get_servers() -> list[dict[str, str]]:
9696
"clientId": "",
9797
"usePkceWithAuthorizationCodeGrant": False,
9898
},
99+
# Disable automatic redirect from /path to /path/ to avoid 307 redirects
100+
# that break proxy routing (Vite proxy rewrites /api/path -> /path,
101+
# but redirect response /path/ doesn't get rewritten back to /api/path/)
102+
redirect_slashes=False,
99103
)
100104

101105
# Mount static files for custom Swagger CSS

apps/api/src/routers/pdl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PDLUpdateOrder(BaseModel):
7070
pdl_orders: list[PDLOrderItem]
7171

7272

73-
@router.get("/", response_model=APIResponse)
73+
@router.get("", response_model=APIResponse)
7474
async def list_pdls(
7575
current_user: User = Depends(get_current_user), db: AsyncSession = Depends(get_db)
7676
) -> APIResponse:
@@ -112,7 +112,7 @@ async def list_pdls(
112112
return APIResponse(success=True, data=[pdl.model_dump() for pdl in pdl_responses])
113113

114114

115-
@router.post("/", response_model=APIResponse, status_code=status.HTTP_201_CREATED)
115+
@router.post("", response_model=APIResponse, status_code=status.HTTP_201_CREATED)
116116
async def create_pdl(
117117
pdl_data: PDLCreate = Body(
118118
...,

apps/api/src/routers/roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
router = APIRouter(prefix="/admin/roles", tags=["Roles"])
1515

1616

17-
@router.get("/", response_model=APIResponse)
17+
@router.get("", response_model=APIResponse)
1818
async def list_roles(
1919
current_user: User = Depends(get_current_user),
2020
db: AsyncSession = Depends(get_db)

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myelectricaldata-web",
3-
"version": "1.4.1",
3+
"version": "1.5.0-dev.1",
44
"type": "module",
55
"scripts": {
66
"dev": "vite",

apps/web/src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ function ProtectedRoute({ children }: { children: React.ReactNode }) {
6161
}
6262

6363
if (!isAuthenticated) {
64-
// Sauvegarder l'URL courante pour y revenir après connexion
65-
return <Navigate to="/login" state={{ from: location.pathname }} replace />
64+
// Sauvegarder l'URL courante (avec query params) pour y revenir après connexion
65+
const fullPath = location.pathname + location.search
66+
return <Navigate to="/login" state={{ from: fullPath }} replace />
6667
}
6768

6869
return <>{children}</>

apps/web/vite.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const __dirname = dirname(__filename)
88

99
export default defineConfig(({ mode }) => {
1010
const env = loadEnv(mode, process.cwd(), '')
11-
const backendUrl = env.VITE_BACKEND_URL || 'http://127.0.0.1:8000'
11+
// Use process.env first (from Docker env_file), then loadEnv, then default
12+
const backendUrl = process.env.VITE_BACKEND_URL || env.VITE_BACKEND_URL || 'http://backend:8000'
1213

1314
return {
1415
plugins: [react()],
@@ -75,6 +76,16 @@ export default defineConfig(({ mode }) => {
7576
hmr: {
7677
clientPort: 8000,
7778
},
79+
// Proxy API requests to backend - ensures same-origin for httpOnly cookies
80+
proxy: {
81+
'/api': {
82+
target: backendUrl,
83+
changeOrigin: true,
84+
rewrite: (path) => path.replace(/^\/api/, ''),
85+
// Forward cookies
86+
cookieDomainRewrite: 'localhost',
87+
},
88+
},
7889
},
7990
test: {
8091
globals: true,

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ services:
104104
- ./apps/web/tsconfig.node.json:/app/tsconfig.node.json
105105
- ./apps/web/tailwind.config.js:/app/tailwind.config.js
106106
- ./apps/web/postcss.config.js:/app/postcss.config.js
107+
- ./.env.web:/app/.env:ro
107108
- /app/node_modules
108109
ports:
109110
- "8000:5173"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myelectricaldata",
3-
"version": "1.4.1",
3+
"version": "1.5.0-dev.1",
44
"private": true,
55
"description": "Secure API gateway for Linky electricity data via Enedis APIs",
66
"repository": {

0 commit comments

Comments
 (0)