add refresh token
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -11,7 +11,8 @@ part of 'core_providers.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.
|
||||
|
||||
@ProviderFor(dioClient)
|
||||
const dioClientProvider = DioClientProvider._();
|
||||
@@ -19,7 +20,8 @@ const dioClientProvider = DioClientProvider._();
|
||||
/// 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.
|
||||
|
||||
final class DioClientProvider
|
||||
extends $FunctionalProvider<DioClient, DioClient, DioClient>
|
||||
@@ -27,7 +29,8 @@ final class DioClientProvider
|
||||
/// 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.
|
||||
const DioClientProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
@@ -61,7 +64,7 @@ final class DioClientProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$dioClientHash() => r'895f0dc2f8d5eab562ad65390e5c6d4a1f722b0d';
|
||||
String _$dioClientHash() => r'a9edc35e0e918bfa8e6c4e3ecd72412fba383cb2';
|
||||
|
||||
/// Provider for SecureStorage (singleton)
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user