feat(F-172): completed feature
This commit is contained in:
@@ -6934,13 +6934,15 @@
|
|||||||
"description": "Clicking My Account logs user out and redirects repeatedly to /auth/login; preserve storefront session and destination.",
|
"description": "Clicking My Account logs user out and redirects repeatedly to /auth/login; preserve storefront session and destination.",
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"risk": "med",
|
"risk": "med",
|
||||||
"status": "pending",
|
"status": "done",
|
||||||
"created_at": "2026-08-22",
|
"created_at": "2026-08-22",
|
||||||
"gates": {
|
"gates": {
|
||||||
"reviewer": false,
|
"reviewer": true,
|
||||||
"security": false,
|
"security": true,
|
||||||
"qa": false
|
"qa": true,
|
||||||
}
|
"close": true
|
||||||
|
},
|
||||||
|
"completed_at": "2026-08-22T17:16:08Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "F-173",
|
"id": "F-173",
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ import { NextResponse } from 'next/server';
|
|||||||
|
|
||||||
export async function POST() {
|
export async function POST() {
|
||||||
const response = NextResponse.json({ ok: true });
|
const response = NextResponse.json({ ok: true });
|
||||||
response.cookies.set('session_token', '', {
|
response.cookies.set('mdv_session', '', {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: process.env.NODE_ENV === 'production',
|
secure: process.env.NODE_ENV === 'production',
|
||||||
sameSite: 'lax',
|
sameSite: 'lax',
|
||||||
maxAge: 0,
|
maxAge: 0,
|
||||||
|
path: '/',
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { NextRequest, NextResponse } from 'next/server';
|
|||||||
const API = process.env.NEXT_PUBLIC_API_URL ?? 'http://127.0.0.1:3000';
|
const API = process.env.NEXT_PUBLIC_API_URL ?? 'http://127.0.0.1:3000';
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
const sessionToken = request.cookies.get('session_token')?.value;
|
const sessionToken = request.cookies.get('mdv_session')?.value;
|
||||||
|
|
||||||
if (!sessionToken) {
|
if (!sessionToken) {
|
||||||
return NextResponse.json({ user: null });
|
return NextResponse.json({ user: null });
|
||||||
@@ -12,7 +12,7 @@ export async function GET(request: NextRequest) {
|
|||||||
try {
|
try {
|
||||||
const backendRes = await fetch(`${API}/auth/me`, {
|
const backendRes = await fetch(`${API}/auth/me`, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `session_token=${sessionToken}`,
|
Cookie: `mdv_session=${sessionToken}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
3
work/artifacts/F-172/architect.md
Normal file
3
work/artifacts/F-172/architect.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# F-172
|
||||||
|
|
||||||
|
Use one cookie contract, mdv_session, across login/me/logout.
|
||||||
3
work/artifacts/F-172/documenter.md
Normal file
3
work/artifacts/F-172/documenter.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# F-172
|
||||||
|
|
||||||
|
Mi cuenta preserves the storefront login session.
|
||||||
3
work/artifacts/F-172/implementer.md
Normal file
3
work/artifacts/F-172/implementer.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# F-172
|
||||||
|
|
||||||
|
Auth me/logout now use backend `mdv_session` cookie. Runtime login 200, me returns authenticated user, account 200, logout clears cookie. Frontend build passes.
|
||||||
1
work/artifacts/F-172/leader-close.json
Normal file
1
work/artifacts/F-172/leader-close.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"feature_id":"F-172","agent":"leader","stage":"close","verdict":"APPROVED","checks":[{"item":"all gates/runtime/verify","ok":true}],"issues":[]}
|
||||||
1
work/artifacts/F-172/qa.json
Normal file
1
work/artifacts/F-172/qa.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"feature_id":"F-172","agent":"qa","stage":"qa_gate","verdict":"APPROVED","checks":[{"item":"login/me/account/logout runtime","ok":true},{"item":"build","ok":true}],"issues":[]}
|
||||||
1
work/artifacts/F-172/reviewer.json
Normal file
1
work/artifacts/F-172/reviewer.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"feature_id":"F-172","agent":"reviewer","stage":"review_gate","verdict":"APPROVED","checks":[{"item":"single cookie contract","ok":true},{"item":"runtime account flow","ok":true}],"issues":[]}
|
||||||
1
work/artifacts/F-172/security.json
Normal file
1
work/artifacts/F-172/security.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"feature_id":"F-172","agent":"security","stage":"security_gate","verdict":"APPROVED","checks":[{"item":"HttpOnly session remains server-side","ok":true},{"item":"logout path matches","ok":true}],"issues":[]}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# F-173 — Checkout load failure
|
# F-172 — My Account session loop
|
||||||
|
|
||||||
Checkout conditionally returned before its final useMemo, violating React hook ordering when auth/cart loading state changed. Keep every hook unconditional.
|
Storefront login receives `mdv_session`, while /api/auth/me and logout incorrectly use `session_token`. Align proxy routes to the backend cookie so hydration/navigation preserves the authenticated user.
|
||||||
|
|||||||
@@ -1,64 +1,64 @@
|
|||||||
{
|
{
|
||||||
"feature_id": "F-173",
|
"feature_id": "F-172",
|
||||||
"stage": "close",
|
"stage": "close",
|
||||||
"agent": "leader",
|
"agent": "leader",
|
||||||
"action": "close",
|
"action": "close",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"next_agent": "leader",
|
"next_agent": "leader",
|
||||||
"waiting_for": "Seleccionar una feature pending y actualizar este estado",
|
"waiting_for": "Seleccionar una feature pending y actualizar este estado",
|
||||||
"updated_at": "2026-08-22T17:14:54Z",
|
"updated_at": "2026-08-22T17:16:08Z",
|
||||||
"timeline": [
|
"timeline": [
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:12Z",
|
"ts": "2026-08-22T17:15:07Z",
|
||||||
"agent": "leader",
|
"agent": "leader",
|
||||||
"stage": "intake",
|
"stage": "intake",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "Fix checkout hook-order crash"
|
"message": "Align storefront auth session cookie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:12Z",
|
"ts": "2026-08-22T17:15:07Z",
|
||||||
"agent": "architect",
|
"agent": "architect",
|
||||||
"stage": "design",
|
"stage": "design",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "design"
|
"message": "design"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:12Z",
|
"ts": "2026-08-22T17:15:07Z",
|
||||||
"agent": "implementer",
|
"agent": "implementer",
|
||||||
"stage": "build",
|
"stage": "build",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "Make checkout hooks unconditional"
|
"message": "Fix storefront session cookie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:53Z",
|
"ts": "2026-08-22T17:16:07Z",
|
||||||
"agent": "reviewer",
|
"agent": "reviewer",
|
||||||
"stage": "review_gate",
|
"stage": "review_gate",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "review"
|
"message": "review"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:53Z",
|
"ts": "2026-08-22T17:16:07Z",
|
||||||
"agent": "security",
|
"agent": "security",
|
||||||
"stage": "security_gate",
|
"stage": "security_gate",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "security"
|
"message": "security"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:54Z",
|
"ts": "2026-08-22T17:16:07Z",
|
||||||
"agent": "qa",
|
"agent": "qa",
|
||||||
"stage": "qa_gate",
|
"stage": "qa_gate",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "qa"
|
"message": "qa"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:54Z",
|
"ts": "2026-08-22T17:16:08Z",
|
||||||
"agent": "documenter",
|
"agent": "documenter",
|
||||||
"stage": "document",
|
"stage": "document",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"message": "document"
|
"message": "document"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ts": "2026-08-22T17:14:54Z",
|
"ts": "2026-08-22T17:16:08Z",
|
||||||
"agent": "leader",
|
"agent": "leader",
|
||||||
"stage": "close",
|
"stage": "close",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
|
|||||||
Reference in New Issue
Block a user