Fix Ptero UserID
This commit is contained in:
parent
6f74a7379f
commit
f53aa0e8b0
|
@ -142,7 +142,7 @@ class RegisterController extends Controller
|
||||||
$user->syncRoles(4);
|
$user->syncRoles(4);
|
||||||
|
|
||||||
$response = $this->pterodactyl->application->post('/application/users', [
|
$response = $this->pterodactyl->application->post('/application/users', [
|
||||||
'external_id' => $user->pterodactyl_id,
|
'external_id' => null,
|
||||||
'username' => $user->name,
|
'username' => $user->name,
|
||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
'first_name' => $user->name,
|
'first_name' => $user->name,
|
||||||
|
@ -152,6 +152,14 @@ class RegisterController extends Controller
|
||||||
'language' => 'en',
|
'language' => 'en',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$user->update([
|
||||||
|
'pterodactyl_id' => $response->json()['attributes']['id'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
$user->delete();
|
$user->delete();
|
||||||
Log::error('Pterodactyl Registration Error: ' . $response->json()['errors'][0]['detail']);
|
Log::error('Pterodactyl Registration Error: ' . $response->json()['errors'][0]['detail']);
|
||||||
|
|
Loading…
Reference in a new issue