entraid integration completa with docs
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Socialite\Facades\Socialite;
|
||||
|
||||
/**
|
||||
* Authentication
|
||||
*/
|
||||
@@ -196,3 +198,25 @@ Route::get('/userarea/upload-photos-mobile', [UploadPhotosMobileController::clas
|
||||
|
||||
Route::post('/userarea/upload-photos-mobile', [UploadPhotosMobileController::class, 'upload'])
|
||||
->name('userarea.upload-photos-mobile.upload');
|
||||
|
||||
// Microsoft Auth Routes
|
||||
Route::get('/auth/microsoft/login', function () {
|
||||
return Socialite::driver('microsoft')->redirect();
|
||||
})->name('auth.microsoft');
|
||||
|
||||
Route::get('/auth/microsoft/callback', function () {
|
||||
try {
|
||||
$user = Socialite::driver('microsoft')->user();
|
||||
return response()->json([
|
||||
'status' => 'SUCCESS',
|
||||
'user_data' => [
|
||||
'id' => $user->getId(),
|
||||
'name' => $user->getName(),
|
||||
'email' => $user->getEmail(),
|
||||
'avatar' => $user->getAvatar(),
|
||||
]
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['status' => 'ERROR', 'message' => $e->getMessage()]);
|
||||
}
|
||||
})->name('auth.microsoft.callback');
|
||||
|
||||
Reference in New Issue
Block a user