Skip to content

Commit c435a04

Browse files
committed
wip
1 parent b30a59f commit c435a04

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ CONNECT_SECRET=
5151
CONNECT_AUTORIZE=https://vatsim-germany.org/oauth/authorize
5252
CONNECT_TOKEN=http://hp.vatsim-germany.org/oauth/token
5353
CONNECT_USER=http://hp.vatsim-germany.org/oauth/userinfo
54+
55+
HOMEPAGE_API_KEY=
56+
STATSIM_API_KEY=FNLb3Dg3xceuAbJFc6sEKBzgXb25dFDzhr4Ym4x4

app/Http/Controllers/LegController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ public function check(Request $request)
5252
'to' => $to,
5353
]);
5454
$url = "$apiUrl?$query";
55+
$key = config('myconfig.statsim_api_key');
5556

5657
try {
57-
$response = Http::acceptJson()->get($url);
58+
$response = Http::withHeaders([
59+
'X-API-Key' => $key,
60+
])->acceptJson()->get($url);
5861
} catch (ConnectionException) {
5962
return Inertia::flash('checkResult', [
6063
'leg_id' => $validated['leg'],

config/myconfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
return [
44
"homepage_api_key" => env('HOMEPAGE_API_KEY'),
5+
"statsim_api_key" => env('STATSIM_API_KEY'),
56
];

0 commit comments

Comments
 (0)