This commit is contained in:
1day2die 2021-12-26 23:37:16 +01:00
parent 5b7374d41a
commit d79ca41033
2 changed files with 10 additions and 1 deletions

View file

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

View file

@ -23,6 +23,12 @@
<small><strong>{{ $message }}</strong></small> <small><strong>{{ $message }}</strong></small>
</span> </span>
@enderror @enderror
@foreach ($errors->all() as $error)
<span class="text-danger" role="alert">
<small><strong>{!! $errors->first() !!}</strong></small>
</span>
@endforeach
@csrf @csrf
<div class="form-group"> <div class="form-group">