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

Duplicate 401 unauthorised error on incorrect access token #1043

Open
d-arkfores-t opened this issue Oct 22, 2018 · 0 comments
Open

Duplicate 401 unauthorised error on incorrect access token #1043

d-arkfores-t opened this issue Oct 22, 2018 · 0 comments

Comments

@d-arkfores-t
Copy link

d-arkfores-t commented Oct 22, 2018

I'm getting duplicate 401 responses when an access token in invalid, the body is invalid JSON so is causing issues.

screen shot 2018-10-22 at 11 48 32

After lots of debugging I've tracked the issue down to the access callback function not returning a boolean value and echoing the error message. Added in this commit: 3d94c6e

Changing the access callback to return false and removing the error output solved the issue for me, my understanding is that nothing should be echo'd from the access callback because it can be called multiple times. This solution does however change the response to a 403 error.

I can't think of a solution that would avoid breaking backwards compatibility, apart from possibly adding a hook invoke to the access callback. Any suggestions on how I can go about making this work for my project?

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

1 participant