简体   繁体   中英

Socialite - how to get a access token from current user who is logged in using facebook

I am new to Laravel and web coding. I set up facebook login system using Socialite. Now I can't figure out, how do I get this logged user in another controller/method.

What Version of Laravel are you using. I'm going to presume its the latest. Laravel provides you with Auth allowing you to use it pretty much anywhere as long as you reference it. At the top of your Controller add.

use Illuminate\Support\Facades\Auth;

and to reference it just use the $user = Auth::user();

Here is the Laravel 5.3 Documentation that has all the information you need. Laravel is very well documented. Authentication

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM