import '../../../../../core/storage/token_storage.dart';

/// ذخیره‌ی محلیِ توکن احراز هویت.
class AuthLocalData {
  final TokenStorage _storage;
  AuthLocalData(this._storage);

  Future<void> saveToken(String token) => _storage.write(token);
  Future<String?> readToken() => _storage.read();
  Future<void> clearToken() => _storage.clear();

  Future<void> saveMobile(String mobile) => _storage.writeMobile(mobile);
  Future<String?> readMobile() => _storage.readMobile();

  Future<bool> hasToken() async {
    final t = await _storage.read();
    return t != null && t.isNotEmpty;
  }
}
