mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add files and updates necessary to manage new layout.
This commit is contained in:
parent
3f61b6d707
commit
aa7d4a610b
@ -103,7 +103,7 @@ class HomeController extends Controller
|
||||
public function index(AccountRepositoryInterface $repository): mixed
|
||||
{
|
||||
if ('v3' === config('firefly.layout')) {
|
||||
die('Please set your layout to "v1".');
|
||||
return view('pwa');
|
||||
}
|
||||
$types = config('firefly.accountTypesByIdentifier.asset');
|
||||
$count = $repository->count($types);
|
||||
|
@ -47,6 +47,7 @@ use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||
use Illuminate\Session\Middleware\AuthenticateSession;
|
||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||
use Laravel\Passport\Http\Middleware\CreateFreshApiToken;
|
||||
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
|
||||
use PragmaRX\Google2FALaravel\Middleware as MFAMiddleware;
|
||||
|
||||
/**
|
||||
@ -177,9 +178,9 @@ class Kernel extends HttpKernel
|
||||
CreateFreshApiToken::class,
|
||||
],
|
||||
|
||||
'apiX' => [
|
||||
'auth:api',
|
||||
//'throttle:60,1',
|
||||
'api' => [
|
||||
EnsureFrontendRequestsAreStateful::class,
|
||||
'auth:api,sanctum',
|
||||
'bindings',
|
||||
],
|
||||
'apiY' => [
|
||||
|
@ -26,6 +26,7 @@ use Adldap\Laravel\Middleware\WindowsAuthenticate;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Passport\Passport;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use URL;
|
||||
|
||||
/**
|
||||
@ -48,6 +49,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
if (config('ldap_auth.identifiers.windows.enabled', false)) {
|
||||
$this->app['router']->pushMiddlewareToGroup('web', WindowsAuthenticate::class);
|
||||
}
|
||||
Sanctum::ignoreMigrations();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,48 +49,25 @@ class RouteServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
public function boot(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
$this->mapCronApiRoutes();
|
||||
$this->mapWebRoutes();
|
||||
$this->routes(function () {
|
||||
Route::prefix('api/v1')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::prefix('api/v1/cron')
|
||||
->middleware('apiY')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api-noauth.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::prefix('api/v1')
|
||||
->middleware('apiX')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapCronApiRoutes(): void
|
||||
{
|
||||
Route::prefix('api/v1/cron')
|
||||
->middleware('apiY')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api-noauth.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ class User extends Authenticatable
|
||||
use Notifiable, HasApiTokens;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
70
config/sanctum.php
Normal file
70
config/sanctum.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Stateful Domains
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Requests from the following domains / hosts will receive stateful API
|
||||
| authentication cookies. Typically, these should include your local
|
||||
| and production domains which access your API via a frontend SPA.
|
||||
|
|
||||
*/
|
||||
|
||||
'stateful' => explode(
|
||||
',', env(
|
||||
'SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
env('APP_URL') ? ',' . parse_url(env('APP_URL'), PHP_URL_HOST) : ''
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array contains the authentication guards that will be checked when
|
||||
| Sanctum is trying to authenticate a request. If none of these guards
|
||||
| are able to authenticate the request, Sanctum will use the bearer
|
||||
| token that's present on an incoming request for authentication.
|
||||
|
|
||||
*/
|
||||
|
||||
'guard' => ['web'],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expiration Minutes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value controls the number of minutes until an issued token will be
|
||||
| considered expired. If this value is null, personal access tokens do
|
||||
| not expire. This won't tweak the lifetime of first-party sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'expiration' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When authenticating your first-party SPA with Sanctum you may need to
|
||||
| customize some of the middleware Sanctum uses while processing the
|
||||
| request. You may change the middleware listed below as required.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'verify_csrf_token' => \FireflyIII\Http\Middleware\VerifyCsrfToken::class,
|
||||
'encrypt_cookies' => \FireflyIII\Http\Middleware\EncryptCookies::class,
|
||||
],
|
||||
|
||||
];
|
@ -24,6 +24,15 @@ declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'home' => 'Home',
|
||||
'budgets' => 'Budgets',
|
||||
'subscriptions' => 'Subscriptions',
|
||||
'transactions' => 'Transactions',
|
||||
'title_expenses' => 'Expenses',
|
||||
'title_withdrawal' => 'Expenses',
|
||||
'title_revenue' => 'Revenue / income',
|
||||
'title_deposit' => 'Revenue / income',
|
||||
'title_transfer' => 'Transfers',
|
||||
'title_transfers' => 'Transfers',
|
||||
'edit_currency' => 'Edit currency ":name"',
|
||||
'delete_currency' => 'Delete currency ":name"',
|
||||
'newPiggyBank' => 'Create a new piggy bank',
|
||||
|
@ -1111,6 +1111,7 @@ return [
|
||||
'make_new_revenue_account' => 'Create a new revenue account',
|
||||
'make_new_liabilities_account' => 'Create a new liability',
|
||||
'asset_accounts' => 'Asset accounts',
|
||||
'undefined_accounts' => 'Accounts',
|
||||
'asset_accounts_inactive' => 'Asset accounts (inactive)',
|
||||
'expense_accounts' => 'Expense accounts',
|
||||
'expense_accounts_inactive' => 'Expense accounts (inactive)',
|
||||
|
1
resources/views/pwa.twig
Normal file
1
resources/views/pwa.twig
Normal file
@ -0,0 +1 @@
|
||||
{% include('../public/v3/index.html') %}
|
Loading…
Reference in New Issue
Block a user