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

Otherkamo-internal
Порезанный
14 октября 2025 г. в 03:35 UTC
Автор
snadjafinia
Обещать
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

Все изменения

Как вы видите судоходство?

Каждое из этих обновлений автоматически попадает в ваше рабочее пространство. Начните бесплатно и смотрите, как он растет неделю за неделей.

Начните бесплатно навсегдаПосмотреть цены