0

I have successfully authenticated users in my front-end via passport api.

But now i want to implement the Laravel socialite to connect/link their account to my app. So i want to get the authenticated user in routes/web.php because i put my redirects and callbacks in there.

I tried adding the auth:api in routes/web.php but still no luck.

Is there a way to get the authenticated user in web routes? or is there a way i can use Laravel/socialite with Laravel/Passport ?

Thank you

Jobins John
  • 1,265
  • 23
  • 45
Hitori
  • 569
  • 1
  • 5
  • 21

1 Answers1

0

I know a way to get the authenticated user with this method:

Route::get('get/user', function (\Illuminate\Http\Request $request) {
      $user = $request->user();
  });
Sergei Krivosheenko
  • 1,136
  • 7
  • 17