Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
fcca3597
Commit
fcca3597
authored
Nov 05, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on middleware.
parent
d5e5947a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
app/Http/Middleware/Authenticated.php
+3
-14
No files found.
app/Http/Middleware/Authenticated.php
View file @
fcca3597
...
...
@@ -3,7 +3,6 @@
use
Closure
;
use
Illuminate\Contracts\Auth\Guard
;
use
Illuminate\Contracts\Routing\Middleware
;
use
Illuminate\Contracts\Routing\ResponseFactory
;
class
Authenticated
implements
Middleware
{
...
...
@@ -15,24 +14,14 @@ class Authenticated implements Middleware {
protected
$auth
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @param ResponseFactory $response
* @return void
*/
public
function
__construct
(
Guard
$auth
,
ResponseFactory
$response
)
public
function
__construct
(
Guard
$auth
)
{
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
}
/**
...
...
@@ -48,11 +37,11 @@ class Authenticated implements Middleware {
{
if
(
$request
->
ajax
())
{
return
$this
->
response
->
make
(
'Unauthorized
'
,
401
);
return
response
(
'Unauthorized.
'
,
401
);
}
else
{
return
$this
->
response
->
redirectG
uest
(
'auth/login'
);
return
redirect
()
->
g
uest
(
'auth/login'
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment