auth state

This commit is contained in:
efrilm
2025-10-24 02:02:00 +07:00
parent ca5d2a58e7
commit 59062f9af1
7 changed files with 930 additions and 9 deletions
@@ -41,4 +41,20 @@ class AuthRepository implements IAuthRepository {
return left(const AuthFailure.unexpectedError());
}
}
@override
Future<Either<AuthFailure, User>> currentUser() async {
try {
User user = await _localDataProvider.currentUser();
return right(user);
} catch (e, s) {
log('currentUserError', name: _logName, error: e, stackTrace: s);
return left(const AuthFailure.unexpectedError());
}
}
@override
Future<bool> hasToken() async {
return await _localDataProvider.hasToken();
}
}