namespace App\Http\Controllers\Auth;
use FAuth;
class LoginController extends Controller
{
/**
* Redirect the user to the GitHub authentication page.
*
* @return Response
*/
public function redirectToFramgiaAuth()
{
return FAuth::redirect();
}
/**
* Obtain the user information from GitHub.
*
* @return Response
*/
public function handleFramgiaAuthCallback()
{
$user = FAuth::user();
// $user->token;
}
}
$user = FAuth::user();
$token = $user->token;
$refreshToken = $user->refreshToken; // not always provided
$expiresIn = $user->expiresIn;
// Example infomation:
$user->getId(); // Or maybe $user->id
$user->getName(); // Or maybe $user->name
$user->getEmail(); // Or maybe $user->email
$user->getAvatar(); // Or maybe $user->avatar
$user->getGender(); // Or maybe $user->gender
$user->getBirthday(); // Or maybe $user->birthday
$user->getPhoneNumber(); // Or maybe $user->phoneNumber
// All infomation about user will be stored here:
$user->getRaw(); // Or maybe $user->user
$user = FAuth::userFromToken($token);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.