Closed mwangimuringi closed 3 days ago
Why use a POST method instead of GET? A POST method is more appropriate for actions that change the server state or involve user data, such as signing out. It prevents unintentional signout from being triggered by clicking a link.
How does this work with tokens stored in HTTP headers? For JWT tokens stored in headers, additional backend logic may be required to blacklist or invalidate tokens.
The user signout functionality is currently missing in the backend. A new API endpoint is needed to handle user signout by clearing the authentication token stored in cookies. Acceptance Criteria:
Tasks:
Add a signout route to the user.route.js file. Use res.clearCookie() to remove the authentication cookie. Return an appropriate success response.