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

Otherkamo-internal
Shipped
14 أكتوبر 2025 في 3:35 ص UTC
صاحب البلاغ
snadjafinia
Commit
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

جميع التغييرات

مثل ما ترى الشحن؟?

كل واحد من هذه تحديثات الأراضي في مكان عملك تلقائيا. ابدأوا بالمجان وشاهدوها تنمو بعد أسبوع.

ابدأوا حراً للأبدخصخصة الفيو