adds the role and I'll go ahead and link and socialite

This commit is contained in:
2026-02-16 12:16:53 +01:00
parent 4dc64c22cb
commit 9a10ff4727
12 changed files with 205 additions and 22 deletions

View File

@@ -38,6 +38,7 @@ public function callback(): RedirectResponse
'photo' => $azureUser->getAvatar(),
'job_title' => Arr::get($azureUser->user, 'jobTitle'),
'department' => Arr::get($azureUser->user, 'department'),
'company_name' => Arr::get($azureUser->user, 'companyName'),
'phone' => Arr::get($azureUser->user, 'mobilePhone', Arr::get($azureUser->user, 'businessPhones.0')),
]
);

View File

@@ -58,6 +58,8 @@ private function getAuthenticatedUser(): ?array
'id' => $user->id,
'name' => $user->name,
'email' => $user->email,
'job_title' => $user->job_title,
'company_name' => $user->company_name,
];
}

View File

@@ -28,6 +28,7 @@ final class User extends Authenticatable
'photo',
'job_title',
'department',
'company_name',
'phone',
'role_id',
];

View File

@@ -1,10 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
use SocialiteProviders\Azure\AzureExtendSocialite;
use SocialiteProviders\Manager\SocialiteWasCalled;
class AppServiceProvider extends ServiceProvider
final class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
@@ -16,9 +21,10 @@ public function register(): void
/**
* Bootstrap any application services.
* Registers the Microsoft Azure Socialite provider for SSO authentication.
*/
public function boot(): void
{
//
Event::listen(SocialiteWasCalled::class, AzureExtendSocialite::class.'@handle');
}
}