From 562064712d07447a757054a2e51b1e553ccc8207 Mon Sep 17 00:00:00 2001 From: xboard Date: Wed, 11 Mar 2026 02:09:25 +0800 Subject: [PATCH] fix(register): handle invalid invite code as API error (#792) --- app/Services/Auth/RegisterService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Auth/RegisterService.php b/app/Services/Auth/RegisterService.php index c55aea8..a87b56a 100644 --- a/app/Services/Auth/RegisterService.php +++ b/app/Services/Auth/RegisterService.php @@ -2,6 +2,7 @@ namespace App\Services\Auth; +use App\Exceptions\ApiException; use App\Models\InviteCode; use App\Models\Plan; use App\Models\User; @@ -113,7 +114,7 @@ class RegisterService if (!$inviteCodeModel) { if ((int) admin_setting('invite_force', 0)) { - throw new \Exception(__('Invalid invitation code')); + throw new ApiException(__('Invalid invitation code')); } return null; }