feat(ecosystem): full Grade 10 curriculum sync, real device fingerprinting, teacher video dashboard, and official textbook assets
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../core/config/app_config.dart';
|
||||
import '../../core/services/device_fingerprint_service.dart';
|
||||
import '../../core/utils/app_logger.dart';
|
||||
import '../models/super_admin_models.dart';
|
||||
|
||||
@@ -15,10 +16,13 @@ class SuperAdminRepository {
|
||||
final token = await _storage.read(key: _tokenKey);
|
||||
if (token == null || token.isEmpty)
|
||||
throw StateError('جلسة السوبر أدمن غير متوفرة.');
|
||||
final fingerprint = await DeviceFingerprintService.getFingerprint();
|
||||
final metadata = await DeviceFingerprintService.getDeviceMetadata();
|
||||
return {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Bearer $token',
|
||||
'X-Device-Fingerprint': 'saqel_super_admin_flutter',
|
||||
'X-Device-Fingerprint': fingerprint,
|
||||
'X-Device-Platform': metadata['platform'] ?? 'unknown',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,18 +63,22 @@ class SuperAdminRepository {
|
||||
}
|
||||
|
||||
Future<void> verifyOtp(String phone, String otp) async {
|
||||
final fingerprint = await DeviceFingerprintService.getFingerprint();
|
||||
final metadata = await DeviceFingerprintService.getDeviceMetadata();
|
||||
final response = await http
|
||||
.post(
|
||||
Uri.parse('${AppConfig.apiBaseUrl}/api/auth/otp/verify'),
|
||||
headers: const {
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
'X-Device-Fingerprint': fingerprint,
|
||||
'X-Device-Platform': metadata['platform'] ?? 'unknown',
|
||||
},
|
||||
body: json.encode({
|
||||
'phone_number': phone,
|
||||
'otp': otp,
|
||||
'role': 'super_admin',
|
||||
'device_fingerprint': 'saqel_super_admin_flutter',
|
||||
'device_fingerprint': fingerprint,
|
||||
}),
|
||||
)
|
||||
.timeout(const Duration(seconds: 30));
|
||||
|
||||
Reference in New Issue
Block a user