Session storage
After login, the platform stores a JWT in browserlocalStorage under the key serviceToken.
The token is sent on every API request:
TOKEN_EXPIRATION (typically 12 hours).
What happens on page refresh
- App reads
serviceTokenfrom storage - Validates JWT expiry client-side
- Calls
GET /user/verifyTokento confirm with server - Restores user profile and reconnects Socket.IO
Logout
Click Logout in the header:POST /user/logout/:userIdinvalidates server session- Token removed from storage
- Socket disconnected
- Browser navigates to
/login
Session expiry
When the token expires or API returns 401:- Axios interceptor redirects to
/login - User must sign in again
Single session / force login
The backend can reject login if the user is already active elsewhere. Use Force Login on the login form to terminate the other session.Socket coupling
A valid app session also opens a Socket.IO connection tagged with youruserId. Logout closes this connection; stale tabs may miss real-time updates until re-login.
Profile updates
Editing/profile updates the user document but keeps the same token unless password change triggers re-auth on the server.