update controllers logic

This commit is contained in:
root
2026-04-23 00:04:35 -04:00
parent 1977a513df
commit ca4ba272fc
353 changed files with 13402 additions and 1301 deletions
@@ -2,8 +2,9 @@
namespace App\Http\Controllers\Api\Auth;
use App\Http\Controllers\Api\BaseApiController;
use App\Http\Controllers\Api\Core\BaseApiController;
use App\Http\Resources\Auth\RegisterResource;
use App\Services\Auth\CodeIgniterApiRegistrationService;
use App\Services\Auth\RegistrationCaptchaService;
use App\Services\Auth\RegistrationService;
use Illuminate\Http\JsonResponse;
@@ -31,6 +32,11 @@ class RegisterController extends BaseApiController
public function store(Request $request): JsonResponse
{
// CodeIgniter-style JSON register (POST api/v1/register): password + no captcha field.
if (! $request->has('captcha') && $request->filled('password')) {
return app(CodeIgniterApiRegistrationService::class)->registerResponse($request);
}
if (app()->runningUnitTests() && $request->header('X-Debug-Request') === '1') {
return response()->json([
'ok' => true,