|
@@ -12,6 +12,7 @@ use Illuminate\Support\Facades\App;
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
use Illuminate\Support\Str;
|
|
|
+use Illuminate\Validation\ValidationException;
|
|
|
|
|
|
class RegisterController extends Controller
|
|
|
{
|
|
@@ -108,13 +109,15 @@ class RegisterController extends Controller
|
|
|
|
|
|
if ($response->failed()) {
|
|
|
$user->delete();
|
|
|
- return $user;
|
|
|
+ throw ValidationException::withMessages([__('Account already exists on Pterodactyl. Please contact the Support!')]);
|
|
|
}
|
|
|
|
|
|
$user->update([
|
|
|
'pterodactyl_id' => $response->json()['attributes']['id']
|
|
|
]);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
return $user;
|
|
|
}
|
|
|
}
|