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

[bug] Not providing token results in wrong error #150

Closed
FlorianLoch opened this issue Feb 1, 2021 · 1 comment
Closed

[bug] Not providing token results in wrong error #150

FlorianLoch opened this issue Feb 1, 2021 · 1 comment

Comments

@FlorianLoch
Copy link
Contributor

FlorianLoch commented Feb 1, 2021

Describe the bug
Not providing any token with a request results in ErrBadToken being given to the error handler. While technically not being wrong that really is not what to be expected when there is an ErrNoToken (which actually never gets returned, see below). It would have saved myself quite some hours of debugging knowing the token did not make it to the backend due to some nginx setting discarding headers with non-compliant names instead of assuming the token is invalid (due to whatever reason).

While being at the code I realised that the only time ErrNoToken being used in the code so far never gets executed (if I did not miss something massively) due to a condition never becoming true.

I want to furthermore annotate that no token being in the session store does not report a clear error. I consider this subpar but fixing it would be a little more invasive (introducing a new error to the API) and would probably require some discussion first.

Versions
Happens with current version as of creating this issue.

Steps to Reproduce
Simply omit the token in a request and investigate the error given to the registered errorHandler resp. look at the HTTP response. You might also have a look at the test case I added.

Code Snippets
I already made a PR (sorry for that, I wanted to verify my concerns first and was not aware of how things get handled in this repo: #149)

@stale
Copy link

stale bot commented Jun 3, 2021

This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.

@stale stale bot added the stale label Jun 3, 2021
@stale stale bot closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant