mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 02:45:58 +00:00
Move authentication around.
This commit is contained in:
@@ -26,6 +26,7 @@ class AccountController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('mainTitleIcon', 'fa-credit-card');
|
View::share('mainTitleIcon', 'fa-credit-card');
|
||||||
View::share('title', trans('firefly.accounts'));
|
View::share('title', trans('firefly.accounts'));
|
||||||
|
@@ -29,6 +29,7 @@ class AttachmentController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('mainTitleIcon', 'fa-paperclip');
|
View::share('mainTitleIcon', 'fa-paperclip');
|
||||||
View::share('title', trans('firefly.attachments'));
|
View::share('title', trans('firefly.attachments'));
|
||||||
|
@@ -22,6 +22,8 @@ use Validator;
|
|||||||
|
|
||||||
class AuthController extends Controller
|
class AuthController extends Controller
|
||||||
{
|
{
|
||||||
|
protected $guard = 'session';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Registration & Login Controller
|
| Registration & Login Controller
|
||||||
@@ -93,7 +95,7 @@ class AuthController extends Controller
|
|||||||
$credentials = $this->getCredentials($request);
|
$credentials = $this->getCredentials($request);
|
||||||
$credentials['blocked'] = 0; // most not be blocked.
|
$credentials['blocked'] = 0; // most not be blocked.
|
||||||
|
|
||||||
if (Auth::guard($this->getGuard())->attempt($credentials, true)) {
|
if (Auth::guard($this->getGuard())->attempt($credentials, $request->has('remember'))) {
|
||||||
return $this->handleUserWasAuthenticated($request, $throttles);
|
return $this->handleUserWasAuthenticated($request, $throttles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@ class BillController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.bills'));
|
View::share('title', trans('firefly.bills'));
|
||||||
View::share('mainTitleIcon', 'fa-calendar-o');
|
View::share('mainTitleIcon', 'fa-calendar-o');
|
||||||
|
@@ -30,6 +30,7 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.budgets'));
|
View::share('title', trans('firefly.budgets'));
|
||||||
View::share('mainTitleIcon', 'fa-tasks');
|
View::share('mainTitleIcon', 'fa-tasks');
|
||||||
|
@@ -29,6 +29,7 @@ class CategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.categories'));
|
View::share('title', trans('firefly.categories'));
|
||||||
View::share('mainTitleIcon', 'fa-bar-chart');
|
View::share('mainTitleIcon', 'fa-bar-chart');
|
||||||
|
@@ -28,6 +28,7 @@ class AccountController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\Account\AccountChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Account\AccountChartGenerator');
|
||||||
|
@@ -27,6 +27,7 @@ class BillController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\Bill\BillChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Bill\BillChartGenerator');
|
||||||
|
@@ -31,6 +31,7 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator');
|
||||||
|
@@ -31,6 +31,7 @@ class CategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\Category\CategoryChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Category\CategoryChartGenerator');
|
||||||
|
@@ -26,6 +26,7 @@ class PiggyBankController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator');
|
||||||
|
@@ -26,6 +26,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = app('FireflyIII\Generator\Chart\Report\ReportChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Report\ReportChartGenerator');
|
||||||
|
@@ -34,6 +34,7 @@ class CsvController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.csv'));
|
View::share('title', trans('firefly.csv'));
|
||||||
View::share('mainTitleIcon', 'fa-file-text-o');
|
View::share('mainTitleIcon', 'fa-file-text-o');
|
||||||
|
@@ -25,6 +25,7 @@ class CurrencyController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.currencies'));
|
View::share('title', trans('firefly.currencies'));
|
||||||
View::share('mainTitleIcon', 'fa-usd');
|
View::share('mainTitleIcon', 'fa-usd');
|
||||||
|
@@ -11,6 +11,10 @@ use Response;
|
|||||||
*/
|
*/
|
||||||
class HelpController extends Controller
|
class HelpController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HelpInterface $help
|
* @param HelpInterface $help
|
||||||
|
@@ -6,6 +6,7 @@ use Config;
|
|||||||
use FireflyIII\Models\Tag;
|
use FireflyIII\Models\Tag;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
||||||
use Input;
|
use Input;
|
||||||
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
@@ -17,6 +18,10 @@ use Steam;
|
|||||||
*/
|
*/
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
public function dateRange()
|
public function dateRange()
|
||||||
{
|
{
|
||||||
@@ -68,6 +73,7 @@ class HomeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(ARI $repository)
|
public function index(ARI $repository)
|
||||||
{
|
{
|
||||||
|
Log::debug('You are at index.');
|
||||||
$types = Config::get('firefly.accountTypesByIdentifier.asset');
|
$types = Config::get('firefly.accountTypesByIdentifier.asset');
|
||||||
$count = $repository->countAccounts($types);
|
$count = $repository->countAccounts($types);
|
||||||
bcscale(2);
|
bcscale(2);
|
||||||
|
@@ -20,6 +20,10 @@ use Session;
|
|||||||
*/
|
*/
|
||||||
class JsonController extends Controller
|
class JsonController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Http\JsonResponse
|
* @return \Illuminate\Http\JsonResponse
|
||||||
|
@@ -17,6 +17,10 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class NewUserController extends Controller
|
class NewUserController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -31,6 +31,7 @@ class PiggyBankController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.piggyBanks'));
|
View::share('title', trans('firefly.piggyBanks'));
|
||||||
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
||||||
|
@@ -20,6 +20,7 @@ class PreferencesController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.preferences'));
|
View::share('title', trans('firefly.preferences'));
|
||||||
View::share('mainTitleIcon', 'fa-gear');
|
View::share('mainTitleIcon', 'fa-gear');
|
||||||
|
@@ -15,6 +15,10 @@ use Session;
|
|||||||
*/
|
*/
|
||||||
class ProfileController extends Controller
|
class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\View\View
|
* @return \Illuminate\View\View
|
||||||
|
@@ -16,6 +16,7 @@ use View;
|
|||||||
class ReportController extends Controller
|
class ReportController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/** @var ReportHelperInterface */
|
/** @var ReportHelperInterface */
|
||||||
protected $helper;
|
protected $helper;
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct(ReportHelperInterface $helper)
|
public function __construct(ReportHelperInterface $helper)
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->helper = $helper;
|
$this->helper = $helper;
|
||||||
|
|
||||||
|
@@ -10,6 +10,11 @@ use Input;
|
|||||||
*/
|
*/
|
||||||
class SearchController extends Controller
|
class SearchController extends Controller
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Results always come in the form of an array [results, count, fullCount]
|
* Results always come in the form of an array [results, count, fullCount]
|
||||||
*
|
*
|
||||||
|
@@ -39,6 +39,7 @@ class TagController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', 'Tags');
|
View::share('title', 'Tags');
|
||||||
View::share('mainTitleIcon', 'fa-tags');
|
View::share('mainTitleIcon', 'fa-tags');
|
||||||
|
@@ -37,6 +37,7 @@ class TransactionController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
View::share('title', trans('firefly.transactions'));
|
View::share('title', trans('firefly.transactions'));
|
||||||
View::share('mainTitleIcon', 'fa-repeat');
|
View::share('mainTitleIcon', 'fa-repeat');
|
||||||
|
@@ -265,13 +265,13 @@ Route::group(
|
|||||||
['middleware' => 'web'], function () {
|
['middleware' => 'web'], function () {
|
||||||
Route::auth();
|
Route::auth();
|
||||||
|
|
||||||
Route::get('/home', 'HomeController@index');
|
//Route::get('/home', 'HomeController@index');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => ['auth', 'range', 'web']], function () {
|
['middleware' => ['range', 'web']], function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Home Controller
|
* Home Controller
|
||||||
|
Reference in New Issue
Block a user