Make *** cookie client-accessible & validate OTK directly in Next.js

Otherkamo-internal
Navios
14 de outubro de 2025 às 03:35 UTC
Autor
snadjafinia
Enviar
d7f7923

Major Simplifications: - *** cookie is now client-accessible (httpOnly: false) - Both Next.js and Java can read the cookie directly - Cookie expires in 30 minutes (matches Redis TTL) OTK Validation (Direct Redis): - Next.js /api/validate now validates OTK directly from Redis - No SecurityService call needed for validation - Fetches *** ID from Redis (key: OTK<otkId>) - Deletes OTK after retrieval (one-time use) - Sets *** cookie for the domain useUserInfo Hook: - Now checks for *** cookie client-side first - If no cookie, skips API call (user not authenticated) - If cookie exists, fetches user info from /api/user-info Benefits: - Eliminates extra API call to SecurityService - Simpler architecture (fewer network hops) - Faster validation (direct Redis access) - Both frontend and backend can access session ID

Todas as alterações

Como o que vês no transporte?

Cada uma dessas atualizações pousa automaticamente em seu espaço de trabalho. Comece grátis e veja crescer semana após semana.

Começar Livre Para SempreVer Preços