Open Phastboy opened 2 weeks ago
Ensure that JWT is correctly handled in different environments with special attention to security in production.
JWT_SECRET
COOKIE_SECURE
COOKIE_MAX_AGE
.env
COOKIE_SECURE = true
httpOnly
SameSite
Secure
HttpOnly
Ensure that JWT is correctly handled in different environments with special attention to security in production.
Tasks:
Step 1: Environment Variable Setup for Security
JWT_SECRET
,COOKIE_SECURE
, andCOOKIE_MAX_AGE
in.env
for different environments (development, production).Step 2: Configure JWT and Cookies for Development and Production
COOKIE_SECURE = true
, ensuring cookies are only sent over HTTPS.httpOnly
flag).Step 3: Implement Secure Cookie Policies
SameSite
cookie policies to avoid issues with cross-site requests.Step 4: Test Cookie Behavior in Both Environments
Secure
,HttpOnly
,SameSite
).Acceptance Criteria: