Skip to content

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.

2 participants