-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathWorkbenchServiceProvider.php
More file actions
38 lines (33 loc) · 1.07 KB
/
WorkbenchServiceProvider.php
File metadata and controls
38 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Workbench\App\Providers;
use Cachet\Cachet;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
use Workbench\App\User;
class WorkbenchServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
config([
'cachet.path' => '/',
'cachet.user_model' => User::class,
]);
// Reinitialize the redirect URIs to ensure they use the correct path for the workbench environment.
config([
'services.keycloak.redirect' => env('KEYCLOAK_REDIRECT_URI', Cachet::dashboardPath().'/oauth/callback/keycloak'),
'services.github.redirect' => env('GITHUB_REDIRECT_URI', Cachet::dashboardPath().'/oauth/callback/github'),
]);
}
/**
* Bootstrap services.
*/
public function boot(): void
{
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
$event->extendSocialite('keycloak', \SocialiteProviders\Keycloak\Provider::class);
});
}
}