Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c2e99b97
authored
Jul 29, 2020
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update middleware
1 parent
108bd185
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
10 deletions
app/Http/Middleware/Authenticate.php
app/Http/Middleware/CheckForMaintenanceMode.php
app/Http/Middleware/EncryptCookies.php
app/Http/Middleware/RedirectIfAuthenticated.php
app/Http/Middleware/TrustHosts.php
app/Http/Middleware/TrustProxies.php
app/Http/Middleware/VerifyCsrfToken.php
app/Http/Middleware/Authenticate.php
View file @
c2e99b9
...
...
@@ -10,7 +10,7 @@ class Authenticate extends Middleware
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
* @return string
|null
*/
protected
function
redirectTo
(
$request
)
{
...
...
@@ -19,3 +19,4 @@ class Authenticate extends Middleware
}
}
}
app/Http/Middleware/CheckForMaintenanceMode.php
View file @
c2e99b9
...
...
@@ -15,3 +15,4 @@ class CheckForMaintenanceMode extends Middleware
//
];
}
app/Http/Middleware/EncryptCookies.php
View file @
c2e99b9
...
...
@@ -15,3 +15,4 @@ class EncryptCookies extends Middleware
//
];
}
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
c2e99b9
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Middleware
;
use
App\Providers\RouteServiceProvider
;
use
Closure
;
use
Illuminate\Support\Facades\Auth
;
...
...
@@ -18,9 +19,10 @@ class RedirectIfAuthenticated
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
return
redirect
(
'/'
);
return
redirect
(
RouteServiceProvider
::
HOME
);
}
return
$next
(
$request
);
}
}
app/Http/Middleware/TrustHosts.php
0 → 100644
View file @
c2e99b9
<?php
namespace
App\Http\Middleware
;
use
Illuminate\Http\Middleware\TrustHosts
as
Middleware
;
class
TrustHosts
extends
Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array
*/
public
function
hosts
()
{
return
[
$this
->
allSubdomainsOfApplicationUrl
(),
];
}
}
app/Http/Middleware/TrustProxies.php
View file @
c2e99b9
...
...
@@ -2,8 +2,8 @@
namespace
App\Http\Middleware
;
use
Illuminate\Http\Request
;
use
Fideloper\Proxy\TrustProxies
as
Middleware
;
use
Illuminate\Http\Request
;
class
TrustProxies
extends
Middleware
{
...
...
app/Http/Middleware/VerifyCsrfToken.php
View file @
c2e99b9
...
...
@@ -7,13 +7,6 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class
VerifyCsrfToken
extends
Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected
$addHttpCookie
=
true
;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment