Use UUID conversion facade

This commit is contained in:
Miguel Nogueira 2020-06-28 00:46:49 +01:00
parent 50692a8abf
commit 599d742e96
2 changed files with 3 additions and 6 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use Closure;
use App\Facades\UUID;
use Illuminate\Support\Facades\Http;
class UsernameUUID
@ -19,13 +20,8 @@ class UsernameUUID
$input = $request->all();
if (isset($input['uuid']))
{
// TODO: Switch to custom Facade
$username = $input['uuid'];
$conversionRequest = Http::get(config('general.urls.mojang.api') . '/users/profiles/minecraft/' . $username)->body();
$decodedConversionRequest = json_decode($conversionRequest, true);
$input['uuid'] = $decodedConversionRequest['id'];
$input['uuid'] = UUID::toUUID($username);
$request->replace($input);
}

1
public/css/home.css vendored Normal file
View File

@ -0,0 +1 @@
.full-img-bg