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

TypeError: TokenModel.findForRequest is not a function #4356

Open
ThatAnonyG opened this issue Jun 18, 2022 · 0 comments
Open

TypeError: TokenModel.findForRequest is not a function #4356

ThatAnonyG opened this issue Jun 18, 2022 · 0 comments
Labels

Comments

@ThatAnonyG
Copy link

Steps to reproduce

Setup the tests with Jest.
Enabled token middleware authentication.
Trying to call protected endpoint via supertest.

Current Behavior

When calling the endpoint from inside any test block like beforeAll or it I am getting the error "TypeError: TokenModel.findForRequest is not a function". And upon logging I see that the function is not even present.

Calling it from setup files like globalSetup or globalTeardown I do not get any such errors.

Expected Behavior

The function should be defined.

Link to reproduction sandbox

I dont know what this means.

Additional information

darwin x64 14.19.1
"loopback": "^3.9.0"
"loopback-boot": "^2.6.5"
"loopback-connector-mysql": "^6.1.0"
"loopback-context": "^3.3.0"

Related Issues

None

@ThatAnonyG ThatAnonyG added the bug label Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant