diff --git a/dist/app/Http/Controllers/Api/Auth/SteamAuthController.php b/dist/app/Http/Controllers/Api/Auth/SteamAuthController.php index d9007d5..b5a68f5 100644 --- a/dist/app/Http/Controllers/Api/Auth/SteamAuthController.php +++ b/dist/app/Http/Controllers/Api/Auth/SteamAuthController.php @@ -20,12 +20,12 @@ public function login(SteamLoginRequest $request) $steamResponse = $steamRequest->authenticateTicket(); if($steamResponse === false) { - $log->info('Authenticating session ticket failed: {error}.', ['error' => $steamRequest->getError()]); + $log->alert('Authenticating session ticket failed: {error}.', ['error' => $steamRequest->getError()]); return response('Error: '.$steamRequest->getError(), 500); } if($steamResponse->isBanned()) { - $log->info('User with SteamID "{id}" denied login. User is Banned via Steam', ['id' => $steamResponse->steamId]); + $log->notice('User with SteamID "{id}" denied login. User is Banned via Steam', ['id' => $steamResponse->steamId]); return response('Unauthorized: You are Steam banned', 401); } diff --git a/dist/app/Http/Controllers/Api/Eula/EulaConsentController.php b/dist/app/Http/Controllers/Api/Eula/EulaConsentController.php index 39656b7..242dc81 100644 --- a/dist/app/Http/Controllers/Api/Eula/EulaConsentController.php +++ b/dist/app/Http/Controllers/Api/Eula/EulaConsentController.php @@ -3,21 +3,25 @@ namespace App\Http\Controllers\Api\Eula; use App\Http\Controllers\Controller; +use App\Http\Responses\Api\Eula\EulaConsentResponse; use Illuminate\Support\Facades\Auth; class EulaConsentController extends Controller { - public function get() + public function get(\Request $request) { $user = Auth::user(); - if($user->eula_consent) - return true; - return false; + $response = new EulaConsentResponse($user->eula_consent, $user->id); + + return json_encode($response); } public function put() { $user = Auth::user(); - dd($user); + $user->eula_consent = true; + $user->save(); + + return json_encode(new EulaConsentResponse(true, $user->id)); } } diff --git a/dist/app/Http/Controllers/Api/Eula/EulaConsentResponse.php b/dist/app/Http/Controllers/Api/Eula/EulaConsentResponse.php deleted file mode 100644 index f8a8f2e..0000000 --- a/dist/app/Http/Controllers/Api/Eula/EulaConsentResponse.php +++ /dev/null @@ -1,8 +0,0 @@ -queryParams = $request->getQueryString(); $log->body = $request->all(); - Log::channel('db_requests')->info(json_encode($log)); + Log::channel('db_requests')->info($log->url."\n".json_encode($log)); return $next($request); } diff --git a/dist/app/Http/Responses/Api/Eula/EulaConsentResponse.php b/dist/app/Http/Responses/Api/Eula/EulaConsentResponse.php new file mode 100644 index 0000000..b15e8cf --- /dev/null +++ b/dist/app/Http/Responses/Api/Eula/EulaConsentResponse.php @@ -0,0 +1,34 @@ +IsGiven = $isGiven; + $this->UserId = $userId; + $this->LatestVersion = new ConsentVersion(); + } +} + +class ConsentVersion { + public function __construct( + public string $Label = "eula2", + public int $EntryDate = 1689714606 + ) + { + } +} \ No newline at end of file diff --git a/dist/config/app.php b/dist/config/app.php index 9207160..20ce181 100644 --- a/dist/config/app.php +++ b/dist/config/app.php @@ -70,7 +70,7 @@ | */ - 'timezone' => 'UTC', + 'timezone' => 'Europe/Berlin', /* |--------------------------------------------------------------------------