Comments (5)
Hi Felix,
I definately like the idea of having the status code within the exception. Although I think it would be better to implement this without symfony's help. Since I would only be using a very small portion of the http-kernel package.
I will add the ability to access the status code in the same way that symfony does:
$exception->getStatusCode();
My plan is to try and get this package to not depend on Laravel (although Laravel setup will remain seamless).
I will let you know how it goes.
Thanks!
from jwt-auth.
I needed this also, done a pull request #17
Please can you have a look when you get some time.
from jwt-auth.
Thanks, #17 merged.
@felnne any thoughts ?
from jwt-auth.
Annoyingly that won't work for my use case, (using the JSON Exception Formatter package) as it only calls getStatusCode()
if the exception is an instance of HttpExceptionInterface
(see here).
Arguably that's an assumption on that package's part, and I accept (and agree) with your point about the full HttpException being overkill just to set a status code. However from a practical standpoint, if you're using this with Laravel you would already have this dependency.
Since my use case is focused on a specific combination of circumstances, I am happy to close this issue since the changes added do satisfy my general need, and I can adapt my exceptions to just pass through the status code. I would also probably open an issue with the other package and see if there's some way of relaxing the limitation of checking for a specific exception type.
Thanks again.
from jwt-auth.
Agreed it's a little presumptious on that packages' end... Closing for now, although I might reconsider down the line
from jwt-auth.
Related Issues (20)
- A refresh token is used only once HOT 2
- Cannot refresh an expired token even if the token is within the allowed refresh time HOT 2
- Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found HOT 1
- setSecret not updating $config
- 401 Unauthorized but passing valid token
- Call to an undefined static method Illuminate\Support\Facades\Auth::refresh() HOT 1
- Performance consideration when only user id is needed
- Upgrade to v2.0 with lcobucci/jwt 4.3.0 crash with package:discover HOT 3
- JWTAuth::attempt return random token if input is null
- Default persistent claims should be configurable
- The GET method is not supported for route api/login. Supported methods: POST.
- post request by axios to laravel giving 500 error HOT 1
- How do we customise the claims? HOT 2
- Get All active tokens
- Method factory on JWTGuard not found
- setSecret method for custom JWT key is not working HOT 1
- Troubleshooting Issues with Laravel Tests and JWT Authentication HOT 2
- Examples for unmentioned routes (like Email Verification) HOT 1
- Followed the Laravel installation and quick start, getting error: "Tymon\\JWTAuth\\JWTGuard::login(): Argument #1 ($user) must be of type Tymon\\JWTAuth\\Contracts\\JWTSubject
- is possible use sap hana obdc with tymondesigns / jwt-auth ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt-auth.