fix(register): handle invalid invite code as API error (#792)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Services\Auth;
|
namespace App\Services\Auth;
|
||||||
|
|
||||||
|
use App\Exceptions\ApiException;
|
||||||
use App\Models\InviteCode;
|
use App\Models\InviteCode;
|
||||||
use App\Models\Plan;
|
use App\Models\Plan;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@@ -113,7 +114,7 @@ class RegisterService
|
|||||||
|
|
||||||
if (!$inviteCodeModel) {
|
if (!$inviteCodeModel) {
|
||||||
if ((int) admin_setting('invite_force', 0)) {
|
if ((int) admin_setting('invite_force', 0)) {
|
||||||
throw new \Exception(__('Invalid invitation code'));
|
throw new ApiException(__('Invalid invitation code'));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user