Google OAuth — Diagnóstico

1. Sistema PHP

✅ PHP 8.4.26
✅ ext curl
✅ ext pdo
✅ ext pdo_mysql
✅ ext openssl
✅ sessions
✅ file_put_contents

2. Variables de entorno

✅ GOOGLE_CLIENT_ID    = 438455853861...
✅ GOOGLE_CLIENT_SECRET = ***NDOH
✅ GOOGLE_REDIRECT_URI = https://walteraltare.com/auth/google/callback
✅ APP_URL             = https://walteraltare.com
   APP_ENV          = production
✅ APP_SECRET          = ***

3. Archivos clave

✅ app/bootstrap.php (1,010 bytes)
✅ app/Models/ComentarioModel.php (13,747 bytes)
✅ auth/google.php (1,482 bytes)
✅ auth/google/callback.php (6,845 bytes)
✅ .htaccess (1,773 bytes)
✅ storage/logs (dir, NO escribible)

4. Base de datos

✅ Conexión PDO OK
✅ tabla lectores
✅ tabla comentarios
✅ tabla comentario_likes
   lectores: 3 registros

5. ComentarioModel

✅ ComentarioModel cargado
✅ método upsertLector existe

6. Escritura de logs

❌ storage/logs/ es escribible
✅ oauth-test.txt (routing test)
❌ oauth-early.txt (callback ejecutó en flujo REAL)

7. Sesión actual

session_id: ce16dd9aafaea8aa5073d8d6c58667fb
oauth_debug: inactivo
oauth_state: (vacío)
lector: (no logueado)

8. Últimas líneas del log

(log vacío o no existe: /home/walteral/public_html/storage/logs/app-2026-10.log)

9. .htaccess en el servidor

❌ NO hay ninguna línea con 'auth', 'google' o 'callback' en el .htaccess
   → El servidor tiene el .htaccess VIEJO sin las reglas de routing OAuth.

10. Verificar callback.php en servidor

✅ versión DEBUG-3 (la última)
✅ $debugMode = true hardcodeado
✅ tiene función oauth_fail
✅ usa str_starts_with para popup

11. .htaccess en subdirectorios auth/

✅ no existe: auth/.htaccess
✅ no existe: auth/google/.htaccess

12. Test directo de routing (sin Google)

Este botón abre directamente /auth/google/callback?state=popup.ROUTING_TEST&code=fake en una nueva pestaña, sin pasar por Google. Si oauth-test.txt aparece después → el routing funciona. Si no → Apache no manda el request a callback.php.

13. Test Login Google

El modo debug está inactivo. Activar modo debug para que el callback muestre errores en pantalla.