fix : login and route
This commit is contained in:
@@ -16,6 +16,5 @@ Future<void> setupAuthDI() async {
|
||||
diAuth.registerCachedFactory<AuthRepositoryImpl>(
|
||||
() => AuthRepositoryImpl(dioRemote),
|
||||
);
|
||||
diAuth.registerLazySingleton<TokenStorageService>(() => TokenStorageService());
|
||||
diAuth.registerLazySingleton<DioErrorHandler>(() => DioErrorHandler());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:rasadyar_core/core.dart';
|
||||
import '../../presentation/routes/pages.dart';
|
||||
|
||||
class AuthMiddleware extends GetMiddleware {
|
||||
var tokenService = diAuth.get<TokenStorageService>();
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
@override
|
||||
RouteSettings? redirect(String? route) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class AuthLogic extends GetxController {
|
||||
|
||||
RxnString phoneNumber = RxnString(null);
|
||||
RxBool isLoading = false.obs;
|
||||
TokenStorageService tokenStorageService = diAuth.get<TokenStorageService>();
|
||||
TokenStorageService tokenStorageService = Get.find<TokenStorageService>();
|
||||
|
||||
Rx<AuthType> authType = AuthType.useAndPass.obs;
|
||||
Rx<AuthStatus> authStatus = AuthStatus.init.obs;
|
||||
|
||||
Reference in New Issue
Block a user