Use UUID conversion facade
This commit is contained in:
parent
50692a8abf
commit
599d742e96
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use App\Facades\UUID;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
class UsernameUUID
|
class UsernameUUID
|
||||||
|
@ -19,13 +20,8 @@ class UsernameUUID
|
||||||
$input = $request->all();
|
$input = $request->all();
|
||||||
if (isset($input['uuid']))
|
if (isset($input['uuid']))
|
||||||
{
|
{
|
||||||
// TODO: Switch to custom Facade
|
|
||||||
$username = $input['uuid'];
|
$username = $input['uuid'];
|
||||||
|
$input['uuid'] = UUID::toUUID($username);
|
||||||
$conversionRequest = Http::get(config('general.urls.mojang.api') . '/users/profiles/minecraft/' . $username)->body();
|
|
||||||
$decodedConversionRequest = json_decode($conversionRequest, true);
|
|
||||||
|
|
||||||
$input['uuid'] = $decodedConversionRequest['id'];
|
|
||||||
|
|
||||||
$request->replace($input);
|
$request->replace($input);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
.full-img-bg
|
Loading…
Reference in New Issue