Skip to content

Jsanchez93/fibonacci-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fibonacci-web

Vendor fibonacci

To use the middlewares you will have to register them in app/Http/Kernel.php under the $routeMiddleware property:

protected $routeMiddleware = [ ... 'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken', 'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken', ];

Add the following code to the render method within app/Exceptions/Handler.php

if ($exception instanceof Tymon\JWTAuth\Exceptions\TokenExpiredException) { return response()->json(['error'=>'token_expired'], $exception->getStatusCode()); } else if ($exception instanceof Tymon\JWTAuth\Exceptions\TokenInvalidException) { return response()->json(['token_invalid'], $exception->getStatusCode()); } else if($exception instanceof \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException ){ return response()->json(['error'=>'token_not_found'], $exception->getStatusCode()); } }

About

Vendor fibonacci

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 52.0%
  • HTML 43.2%
  • JavaScript 3.7%
  • CSS 1.1%