Go to file
google-labs-jules[bot] 6e56e164df Fix: Prevent automatic logout when starting app offline
Problem:
The application would inadvertently log you out if it was started while offline.
This occurred because the `fetchCurrentUser` action in the `authStore` would attempt to fetch your profile, and if this network request failed (as it does when offline), the catch block would unconditionally call `clearTokens()`. This removed the authentication token, effectively logging you out and preventing access to any cached data or offline functionality.

Solution:
I modified the `fetchCurrentUser` action in `fe/src/stores/auth.ts`:
- The `catch` block now inspects the error.
- `clearTokens()` is only called if the error is a specific HTTP authentication error from the server (401 Unauthorized or 403 Forbidden) when online.
- For network errors (indicating offline status) or other non-auth HTTP errors, tokens are preserved. The user object (`user.value`) might remain null if no cached profile is available, but the authentication token itself is kept.

This change allows the application to remain in a logged-in state when started offline. The service worker can then serve cached API responses, and you can view previously accessed data. Navigation guards rely on `isAuthenticated` (which now remains true offline as long as a token exists), so you are not incorrectly redirected to the login page.
2025-06-07 20:30:52 +00:00
.cursor/rules Remove deprecated task management files and enhance group management functionality 2025-06-07 18:05:08 +02:00
.gitea/workflows refactor: Optimize Dockerfiles and deployment workflow for improved performance and reliability 2025-06-01 16:26:49 +02:00
be Update logging level to INFO, refine chore update logic, and enhance invite acceptance flow 2025-06-07 22:07:35 +02:00
docs Remove deprecated task management files and enhance group management functionality 2025-06-07 18:05:08 +02:00
fe Fix: Prevent automatic logout when starting app offline 2025-06-07 20:30:52 +00:00
docker-compose.prod.yml Refactor: Simplify docker-compose configuration by removing unused services and optimizing backend settings 2025-06-01 19:18:42 +02:00
docker-compose.yml Fix(docker): Run Alembic migrations on container startup 2025-06-01 17:10:40 +00:00
env.production.template Fix: Resolve Google OAuth redirection issue 2025-06-02 00:19:26 +02:00