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

Modify Error response message on /token API #296

Open
abhijit-goswami opened this issue Jan 9, 2024 · 2 comments
Open

Modify Error response message on /token API #296

abhijit-goswami opened this issue Jan 9, 2024 · 2 comments

Comments

@abhijit-goswami
Copy link

Context

I’m using JWT to authenticate users from my app, and everything works as expected.

Is there a way I can modify the error response message in /token API?

image

I tried jwt_auth_token_before_sign and jwt_auth_token_before_dispatch filters but these only works if the credentials are valid.

@nurullahturkoglu
Copy link

You can modify the error message you want to give from line 147 in the public/class-jwt-auth-public.php file. If you have specific messages for certain situations, you can use a structure like switch-case.

answer-detail

@abhijit-goswami
Copy link
Author

@nurullahturkoglu This can bs used as a fix but it's not a standard way to modify plugin files. I was actually asking for a hook.

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

No branches or pull requests

2 participants