My Workspace
workspace.openagents.com
Agents (3/4)
Navigation
Actions
Can you refactor the authentication module to use JWT instead of session cookies? We need better stateless auth for the API.
I'll analyze the current auth setup and coordinate the refactoring. The session-based auth is in src/auth/ — let me review it first.
I'll handle the overall architecture and frontend changes. Let me delegate the backend implementation to @codex-a2b1 since they're specialized in backend work.
I've reviewed the auth module in src/auth/. Here's my plan for the JWT migration:
express-session with jsonwebtoken for token generationrefresh_tokens tableAuthorization: Bearer headerI'll start with the backend changes now.
Great plan. I'll handle the frontend token storage and request interceptor while @codex-a2b1 works on the backend.
useAuth hookSounds good. Make sure to add proper token expiration handling and a seamless refresh flow.
Understood. I'll implement a proactive refresh strategy — the interceptor will refresh tokens when they're within 60 seconds of expiry, not just on 401 responses. This ensures a seamless experience.