This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
site-base/app/Http/Controllers/Auth/SocialLoginController.php
2018-05-07 21:34:10 +10:00

34 lines
624 B
PHP

<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use Socialite;
class SocialLoginController extends Controller
{
public function redirectToProvider($provider)
{
return Socialite::with($provider)->redirect();
}
public function handleProviderCallback($provider)
{
$openiduser = Socialite::with($provider)->user();
$user = Socialite::with($provider)->findOrCreateUser($openiduser);
Auth::login($user,FALSE);
/*
if (! $user->profile_update)
{
return redirect()->to(url('settings'));
}
*/
return redirect()->intended();
}
}