add refresh token

This commit is contained in:
Phuoc Nguyen
2025-10-21 16:30:11 +07:00
parent b94a19dd3f
commit 9c20a44a04
21 changed files with 246 additions and 67 deletions

View File

@@ -7,10 +7,12 @@ part 'core_providers.g.dart';
/// Provider for DioClient (singleton)
///
/// This is the global HTTP client used across the entire app.
/// It's configured with interceptors, timeout settings, and auth token injection.
/// It's configured with interceptors, timeout settings, auth token injection,
/// and automatic token refresh on 401 errors.
@Riverpod(keepAlive: true)
DioClient dioClient(Ref ref) {
return DioClient();
final storage = ref.watch(secureStorageProvider);
return DioClient(secureStorage: storage);
}
/// Provider for SecureStorage (singleton)