Refactor(Auth): Complete auth folder restructuring, security patches, and Flutter endpoint updates

This commit is contained in:
Hamza-Ayed
2026-07-09 05:22:05 +03:00
parent 45859883a5
commit 87dc925ea7
37 changed files with 40 additions and 31 deletions
@@ -97,7 +97,7 @@ class OtpVerificationController extends GetxController {
// توجه إلى الصفحة التالية
await CRUD().post(
link: '${AppLink.paymentServer}/auth/token/update_driver_auth.php',
link: AppLink.addTokensDriver,
payload: {
'token': box.read(BoxName.tokenDriver).toString(),
'fingerPrint': finger.toString(),
@@ -764,7 +764,7 @@ class RegistrationController extends GetxController {
// isLoading.value = true;
// final uri = Uri.parse(
// 'https://intaleq.xyz/siro/auth/syria/driver/register_driver_and_car.php',
// 'https://intaleq.xyz/siro/auth/driver/register.php',
// );
// final client = http.Client();
@@ -48,10 +48,10 @@ void main() async {
print(' Request: { phone_number: "$phone", code: "123456", device_token: "fp_abc123" }');
print(' ✅ Phone verified, driver_id returned');
// Check: GET /auth/syria/driver/isPhoneVerified.php
// Check: GET /auth/driver/isPhoneVerified.php
// Query: phone_number
// Returns: success if is_verified = 1
print(' → GET /auth/syria/driver/isPhoneVerified.php?phone_number=$phone');
print(' → GET /auth/driver/isPhoneVerified.php?phone_number=$phone');
print(' ✅ Phone is verified, proceeding to registration');
// ================================================================
@@ -157,7 +157,7 @@ void main() async {
for (final docType in uploadDocTypes) {
print(' 📤 Uploading: $docType');
print(' → POST /auth/syria/uploadSyrianDocs.php');
print(' → POST /auth/driver/uploadDriverDocs.php');
print(' Fields: driver_id=$driverId, doc_type=$docType, file (multipart)');
print(' File stored: private_uploads/<hash>/<driverId>__${docType}.jpg');
print(' MIME validation: image/jpeg, image/png, image/webp');
@@ -179,7 +179,7 @@ void main() async {
// STEP 6: Final Registration Submission
// ================================================================
print('\n─── STEP 6: Final Registration (register_driver_and_car.php) ───');
print(' → POST /auth/syria/driver/register_driver_and_car.php');
print(' → POST /auth/driver/register.php');
print(' This is the MAIN orchestrator. It does:');
print(' 1. Phone number normalization (Syria/Jordan/Egypt logic)');
print(' 2. Encrypt sensitive fields (phone, email, name, address, etc.)');
@@ -256,14 +256,14 @@ void main() async {
// Admin fetches pending drivers
print(' 🔍 Admin fetches pending drivers:');
print(' → GET /auth/syria/driver/drivers_pending_list.php');
print(' → GET /auth/driver/drivers_pending_list.php');
print(' Decrypts: phone, first_name, last_name');
print(' Returns: [{ id: "$driverId", first_name: "أحمد", last_name: "الأسد", phone: "$phone" }]');
print(' ✅ Driver appears in pending list (status != "active")');
// Admin views details
print('\n 📋 Admin views driver details:');
print(' → GET /auth/syria/driver/driver_details.php?driver_id=$driverId');
print(' → GET /auth/driver/driver_details.php?driver_id=$driverId');
print(' Returns: driver row + car registration + document links');
print(' ✅ Admin reviews all documents');
@@ -301,12 +301,12 @@ void main() async {
print(' - ml_google_doc.dart (phone OCR scanner)');
print(' Backend (PHP):');
print(' - /auth/otp/request.php + verify.php');
print(' - /auth/syria/driver/isPhoneVerified.php');
print(' - /auth/driver/isPhoneVerified.php');
print(' - /auth/document_syria/ai_document.php');
print(' - /auth/syria/uploadSyrianDocs.php');
print(' - /auth/syria/driver/register_driver_and_car.php');
print(' - /auth/syria/driver/drivers_pending_list.php');
print(' - /auth/syria/driver/driver_details.php');
print(' - /auth/driver/uploadDriverDocs.php');
print(' - /auth/driver/register.php');
print(' - /auth/driver/drivers_pending_list.php');
print(' - /auth/driver/driver_details.php');
print(' - /serviceapp/getDriversWaitingActive.php');
print(' - /Admin/Staff/activate.php');
print(' Schema:');