Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Add JWTNotFoundEvent #188

Merged
merged 1 commit into from
Jul 7, 2016
Merged

[DX] Add JWTNotFoundEvent #188

merged 1 commit into from
Jul 7, 2016

Conversation

chalasr
Copy link
Collaborator

@chalasr chalasr commented Jul 2, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets #187, #159 (comment)
Tests pass? yes

As discussed in the fixed tickets,, I propose to add a specific JWT_NOT_FOUND, making users able to catch this event and set a custom response if they want, or just ignore it.
It can be useful to secure routes that are part of anonymous firewalls, for restrict it to a specific user role for instance, or just have the same behaviour as on JWT_INVALID.

Also it introduces an interface implemented by both JWT_NOT_FOUND and JWT_INVALID, so the same (listener) method can be used to listen on both events.

Closes #187.

@chalasr
Copy link
Collaborator Author

chalasr commented Jul 5, 2016

@slashfan The issue fixed by this PR exists for a long time, plus it will helps for #184.
If you agree, after you reviewed it I think we can draft the v1.6.0 minor release.

Add JWTNotFoundEvent
Add JWTFailureEventInterface implemented by both JWTNotFoundEvent and JWTInvalidEvent
Dispatch the JWTNotFound when no token is found in the request (from JWTListener)
Tests that the good event is dispatched in JWTListenerTest
Add documentation
Fix bad description in Events::JWT_NOT_FOUND
Fix typos in documentation
@chalasr chalasr merged commit e84d3ef into master Jul 7, 2016
@chalasr chalasr deleted the jwt_not_found_event branch July 7, 2016 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lexik_jwt_authentication.on_jwt_invalid fired only for valid JWTS
1 participant