Add UserResource and OIDC linking to Filament user menu

This commit is contained in:
2026-04-26 16:38:43 -04:00
parent c2c9464133
commit ad02f65b54
6 changed files with 127 additions and 0 deletions
@@ -24,6 +24,16 @@ class SocialiteController extends Controller
return redirect('/login')->with('error', 'Authentication failed.');
}
if (Auth::check()) {
$user = Auth::user();
$user->update([
'provider_name' => $provider,
'provider_id' => $socialUser->getId(),
]);
return redirect()->intended('/admin')->with('status', 'Account linked successfully!');
}
// Find user by provider_id
$user = User::where('provider_name', $provider)
->where('provider_id', $socialUser->getId())