refactor: update OTP system to support user-specific verification tables with legacy encryption and multi-role authentication.

This commit is contained in:
Hamza-Ayed
2026-04-23 17:03:38 +03:00
parent d64a423db9
commit 098aa9ad37
10 changed files with 649 additions and 189 deletions

View File

@@ -159,7 +159,17 @@ class HmacAuthMiddleware
->where('api_key', $apiKey)
->first();
return $admin;
if ($admin) return $admin;
// Check service customers/employees (users table)
$serviceUser = DB::connection('primary')
->table('users')
->select('id as user_id', 'api_secret')
->selectRaw("'service_user' as user_type")
->where('api_key', $apiKey)
->first();
return $serviceUser;
});
}
}