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

feat: Pass DisabledException to JWTAuthenticationFailureResponse #1187

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

arneee
Copy link

@arneee arneee commented Dec 23, 2023

Hi,

currently the response is always "Bad credentials". If a user has been disabled, the response should be accordingly so the user can take additional steps, for example contacting the admin.

This PR checks if the AuthenticationException "previous" is a DisabledException and passes that instead.

What do you think?

@arneee arneee changed the title Pass DisabledException to JWTAuthenticationFailureResponse feat: Pass DisabledException to JWTAuthenticationFailureResponse Dec 23, 2023
@arneee arneee marked this pull request as draft December 23, 2023 19:31
@arneee arneee marked this pull request as ready for review December 23, 2023 20:07
@mbabker
Copy link
Contributor

mbabker commented Jan 9, 2024

This seems like a very application-specific thing to me. Passing through whatever exception the authentication system gives to the failure handler is the best thing for the bundle to do IMO, and an application can make checks like this to adjust the response either in a decorated failure handler or through the authentication failure event that is dispatched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants