When your LeetCode session expires, API calls start failing silently or show raw error messages. The user has no idea why things stopped working or what to do about it. They have to guess that their session expired and manually log out and log back in.
What should happen
- When an API call fails due to an expired/invalid session, show a clear notification like "Session expired. Press L to logout and re-login."
- Optionally, auto-redirect to the login screen with a message explaining what happened
Things to consider
- Check
api/auth.py and api/client.py to see how auth errors are currently detected
- The app already has a notification system (
app.notify()). Use it to show the expiry message
- Don't log the user out automatically without telling them. Show the message first and let them take action
- Test by manually invalidating your session cookie in
~/.leetshell/config.json
When your LeetCode session expires, API calls start failing silently or show raw error messages. The user has no idea why things stopped working or what to do about it. They have to guess that their session expired and manually log out and log back in.
What should happen
Things to consider
api/auth.pyandapi/client.pyto see how auth errors are currently detectedapp.notify()). Use it to show the expiry message~/.leetshell/config.json