mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
* Fixes for datatables * Implement a BaseModel * Working on reusable header data model * Working on adding session variables * Clean up header data * Random Data Seeder * working on searching datatables across relationships. * Working on transforming primary keys between client and server facinglogic * Updated assets
61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Auth;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Utils\Traits\UserSessionAttributes;
|
|
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
|
use Laravel\Socialite\Facades\Socialite;
|
|
use Illuminate\Http\Request;
|
|
|
|
class LoginController extends Controller
|
|
{
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Login Controller
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This controller handles authenticating users for the application and
|
|
| redirecting them to your home screen. The controller uses a trait
|
|
| to conveniently provide its functionality to your applications.
|
|
|
|
|
*/
|
|
|
|
use AuthenticatesUsers;
|
|
use UserSessionAttributes;
|
|
|
|
/**
|
|
* Where to redirect users after login.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $redirectTo = '/dashboard';
|
|
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('guest:user')->except('logout');
|
|
}
|
|
|
|
public function authenticated(Request $request, $user)
|
|
{
|
|
$this->setCurrentCompanyId($user->companies()->first()->account->default_company_id);
|
|
}
|
|
|
|
public function redirectToProvider($provider)
|
|
{
|
|
return Socialite::driver($provider)->redirect();
|
|
}
|
|
|
|
public function handleProviderCallback($provider)
|
|
{
|
|
$user = Socialite::driver('github')->user();
|
|
|
|
dd($user);
|
|
}
|
|
}
|