- Ya
- 14 Oktoba 2025, 03:35 UTC
- Mwandishi
- snadjafinia
- Ahadi ya
- 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