fix(auth): prevent AuthNotifier auto-dispose causing theme toggle logout
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 3m1s

Applied @persistentRiverpod annotation to AuthNotifier so it persists
for app lifetime. Previously, theme changes could trigger AuthProvider
rebuild via auto-dispose, causing AsyncLoading state and auth issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-01-05 09:50:48 +01:00
co-authored by Claude Opus 4.5
parent 265ca5959d
commit 6b6614f482
4 changed files with 17 additions and 9 deletions
+7 -7
View File
@@ -447,13 +447,13 @@ Dio coreApiClient(Ref ref) { ... }
**When to use `@persistentRiverpod`:**
| Use Case | Annotation |
|----------|------------|
| API clients with interceptors | `@persistentRiverpod` |
| Theme/config providers | `@persistentRiverpod` |
| Auth state provider | `@persistentRiverpod` |
| Feature data providers | `@riverpod` (default) |
| UI state providers | `@riverpod` (default) |
| Use Case | Annotation | Example |
|----------|------------|---------|
| API clients with interceptors | `@persistentRiverpod` | `coreApiClient`, `tatlockApiClient` |
| Auth state provider | `@persistentRiverpod` | `AuthNotifier` |
| Theme/config providers | `@persistentRiverpod` | `ThemeNotifier` |
| Feature data providers | `@riverpod` (default) | `ContainersNotifier` |
| UI state providers | `@riverpod` (default) | `SearchFilterNotifier` |
## File Naming Conventions