forked from TFMM/silent-auction
Add UserResource and OIDC linking to Filament user menu
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user