CULTIVA IA — Skill: Escritor de Pull Requests para Git
🔬
nutritrack / nutritrack-api
FastAPI · PostgreSQL · Celery — SaaS B2B de seguimiento nutricional
feat/auth-inactive-users
Analisis del diff
main...feat/auth-inactive-users — 3 archivos modificados
+34
Adiciones
-6
Eliminaciones
3
Archivos
3
Commits
api/auth/views.py
+12 -6
api/auth/tests/test_login.py
+22 -0
api/middleware/auth_middleware.py
+0 -1
Commits incluidos
a1b2c3d redirect inactive users to reactivation before login next URL fix
e4f5g6h add regression test for inactive user GET redirect loop test
7h8i9j0 remove leftover TODO comment in auth middleware chore
Pull Request generado
Draft
fix(auth) Redirect inactive authenticated users to reactivation before honoring login next URL
AG
alvaro-gimeno
hace 2 horas
feat/auth-inactive-users → main

Inactive authenticated users are now redirected to /auth/reactivate/ before the GET login view honors a ?next= URL. Previously, the GET path redirected authenticated users directly to the requested destination without checking is_active, which could trap an inactive user in a redirect loop between /auth/login/ and a protected view.

The POST login path already applied the is_active guard correctly; this change ports the same check to the GET redirect branch and adds a regression test that confirms the loop no longer occurs when an inactive user arrives with a next parameter.

Archivos cambiados — 3
M api/auth/views.py +12 -6
M api/auth/tests/test_login.py +22 -0
M api/middleware/auth_middleware.py +0 -1
Comando generado (gh CLI)
Terminal — gh pr create
gh pr create --draft \ --title "fix(auth): Redirect inactive authenticated users to reactivation before honoring login next URL" \ --body "$(cat <<'EOF' Inactive authenticated users are now redirected to \`/auth/reactivate/\` before the GET login view honors a \`?next=\` URL. Previously, the GET path redirected authenticated users directly to the requested destination without checking \`is_active\`, which could trap an inactive user in a redirect loop between \`/auth/login/\` and a protected view. The POST login path already applied the \`is_active\` guard correctly; this change ports the same check to the GET redirect branch and adds a regression test that confirms the loop no longer occurs when an inactive user arrives with a \`next\` parameter. EOF )"
Validacion de reglas — 8/8 cumplidas
Tipo semantico correcto: fix (no feat, ya que corrige un comportamiento incorrecto existente)
Scope preciso: (auth) — el narrowest accurate scope del cambio
Sin etiquetas de proceso: sin [codex], [claude], [ai], [wip] en el titulo
Sin atribucion a herramientas: sin "Generated by", "AI-assisted" ni similar
Descripcion orientada al revisor: explica el bucle de redireccion, el guard existente en POST y la cobertura del test
Sin referencias a issues inventadas: no hay ID de ticket verificado, la linea se omite
Cambio dominante como titulo: el fix del GET path, no el commit del chore
Sin punto al final del titulo, sin verbos vagos (update/cleanup/fix stuff)