Description
The application currently lack a persistent session management system. Users need to stay logged in without sending passwords on every request, and we need to differentiate between Farmer and Shopkeeper roles.
Proposed Solution
I propose implementing a professional JWT authentication layer:
- Create
login endpoint that issues both an Access Token and a Refresh Token.
- Store Refresh Tokens in secure, HttpOnly cookies to prevent XSS.
- Implement a
/refresh endpoint to rotate access tokens.
- Create
@token_required and @roles_required('admin') decorators for route protection.
- Integrate with the existing Bcrypt-hashed password system.
Impact
- Enables secure, long-term user sessions.
- Foundation for personalized farmer dashboards.
- Prevents unauthorized access to sensitive financial data.
I am ready to implement this industry-standard security flow. Please assign this to me.