Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
8312ca2a
Commit
8312ca2a
authored
Jul 05, 2018
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unwanted file and update readme
parent
95c68d8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
36 deletions
+4
-36
README.md
README.md
+4
-1
VerifyJWTToken.php
app/Http/Middleware/VerifyJWTToken.php
+0
-35
No files found.
README.md
View file @
8312ca2a
...
...
@@ -54,6 +54,9 @@ Generate a new application key
php artisan key:generate
Generate a new JWT secret key (If you want to use API)
php artisan jwt:secret
Generate a new JWT authentication secret key
php artisan jwt:secret
...
...
@@ -79,7 +82,7 @@ For generating the files of unisharp file manager
php artisan vendor:publish --tag=lfm_public
For linking storage folder in public
php artisan storage:link
Start the local development server
...
...
app/Http/Middleware/VerifyJWTToken.php
deleted
100755 → 0
View file @
95c68d8c
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
JWTAuth
;
use
Tymon\JWTAuth\Exceptions\JWTException
;
class
VerifyJWTToken
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
try
{
$user
=
JWTAuth
::
parseToken
()
->
authenticate
();
}
catch
(
JWTException
$e
)
{
if
(
$e
instanceof
\Tymon\JWTAuth\Exceptions\TokenExpiredException
)
{
return
response
()
->
json
([
'token_expired'
],
$e
->
getStatusCode
());
}
elseif
(
$e
instanceof
\Tymon\JWTAuth\Exceptions\TokenInvalidException
)
{
return
response
()
->
json
([
'token_invalid'
],
$e
->
getStatusCode
());
}
else
{
return
response
()
->
json
([
'error'
=>
'Token is required'
]);
}
}
return
$next
(
$request
);
}
}
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