This commit is contained in:
Andras Bacsai
2023-06-19 09:14:09 +02:00
parent c407306db5
commit 716c9aa860
5 changed files with 5 additions and 13 deletions

View File

@@ -29,6 +29,7 @@ Route::get('/source/github/redirect', function () {
'private_key' => $private_key,
'team_id' => $github_app->team_id
]);
$github_app->name = $slug;
$github_app->app_id = $id;
$github_app->client_id = $client_id;
$github_app->client_secret = $client_secret;
@@ -51,13 +52,6 @@ Route::get('/source/github/install', function () {
$github_app->installation_id = $installation_id;
$github_app->save();
}
// Must check the slug in case the user changes it in the GitHub App settings
$token = generate_github_jwt_token($github_app);
$response = Http::github($github_app->api_url, $token)->get('/app');
$slug = data_get($response->json(), 'slug');
$github_app->name = $slug;
$github_app->save();
return redirect()->route('source.github.show', ['github_app_uuid' => $github_app->uuid]);
} catch (\Exception $e) {
return general_error_handler(err: $e);