2FAuth/app/Http/Kernel.php

103 lines
4.2 KiB
PHP
Raw Normal View History

2019-05-20 07:37:41 +02:00
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
2023-03-26 23:04:06 +02:00
* @var array<int, class-string|string>
2019-05-20 07:37:41 +02:00
*/
protected $middleware = [
2022-11-14 17:10:47 +01:00
// \App\Http\Middleware\TrustHosts::class,
2021-12-02 13:15:53 +01:00
\App\Http\Middleware\TrustProxies::class,
2022-11-14 17:10:47 +01:00
\Illuminate\Http\Middleware\HandleCors::class,
2021-12-02 13:15:53 +01:00
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
2019-05-20 07:37:41 +02:00
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
2021-09-06 18:07:14 +02:00
\App\Http\Middleware\ForceJsonResponse::class,
2019-05-20 07:37:41 +02:00
];
/**
* The application's route middleware groups.
*
2023-03-26 23:04:06 +02:00
* @var array<string, array<int, class-string|string>>
2019-05-20 07:37:41 +02:00
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\SetLanguage::class,
\App\Http\Middleware\CustomCreateFreshApiToken::class,
],
'behind-auth' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
// \Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\Authenticate::class,
\App\Http\Middleware\KickOutInactiveUser::class,
\App\Http\Middleware\LogUserLastSeen::class,
\App\Http\Middleware\SetLanguage::class,
\App\Http\Middleware\CustomCreateFreshApiToken::class,
2019-05-20 07:37:41 +02:00
],
2021-11-04 23:57:23 +01:00
'api.v1' => [
2023-12-20 16:55:58 +01:00
\Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
2021-12-02 13:15:53 +01:00
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\KickOutInactiveUser::class,
2020-10-08 15:38:36 +02:00
\App\Http\Middleware\LogUserLastSeen::class,
\App\Http\Middleware\SetLanguage::class,
2019-05-20 07:37:41 +02:00
],
];
/**
2023-08-01 16:33:55 +02:00
* The application's middleware aliases.
2019-05-20 07:37:41 +02:00
*
2023-08-01 11:26:58 +02:00
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
2019-05-20 07:37:41 +02:00
*
2023-03-26 23:04:06 +02:00
* @var array<string, class-string|string>
2019-05-20 07:37:41 +02:00
*/
2023-08-01 11:26:58 +02:00
protected $middlewareAliases = [
2022-11-22 15:15:52 +01:00
'auth' => \App\Http\Middleware\Authenticate::class,
2023-02-25 21:12:10 +01:00
'admin' => \App\Http\Middleware\AdminOnly::class,
2022-11-22 15:15:52 +01:00
'guest' => \App\Http\Middleware\RejectIfAuthenticated::class,
'SkipIfAuthenticated' => \App\Http\Middleware\SkipIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'rejectIfDemoMode' => \App\Http\Middleware\RejectIfDemoMode::class,
'rejectIfReverseProxy' => \App\Http\Middleware\RejectIfReverseProxy::class,
2022-11-22 15:15:52 +01:00
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
2022-11-14 17:10:47 +01:00
// 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
// 'signed' => \App\Http\Middleware\ValidateSignature::class,
2019-05-20 07:37:41 +02:00
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var string[]
2019-05-20 07:37:41 +02:00
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\App\Http\Middleware\SetLanguage::class,
2019-05-20 07:37:41 +02:00
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}