Commit 8312ca2a authored by Viral Solani's avatar Viral Solani

remove unwanted file and update readme

parent 95c68d8c
......@@ -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
......
<?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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment