feathers: Intermittent NotAuthenticated: No auth token
I have a bizarre issue that I can’t find the root cause of and it’s only just manifested itself. The request I’m making to a service then has a few hooks that perform updates on other services but every so often during the various updates I get the error NotAuthenticated: No auth token
. Restarting the feathers app seems to clear it sometimes and then the exact same request will work.
I’m assuming that somehow on occasion my headers are getting removed but I have no idea what would cause that to happen, and I’ve checked to make sure the header is being sent every time.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (8 by maintainers)
@jamesholcomb. Thanks, that works for me as well. Looked up the documentation and it makes sense, kind off. If it’s optional though as the documentation says it is, this should be considered a bug.
Try adding
provider: undefined
to yourpopulate
schema hook argument. That fixed my particular issue.Thank you. I followed your advice and https://docs.feathersjs.com/api/express.html#custom-service-middleware and it is now working correctly. I created a custom service with a dummy class so that I can get a place for the hook to get the data I need then added a middleware that runs after the service. What I was trying before was to get the data into the middleware function directly. May be that is not possible? Sorry for posting all this code here but I searched for a long time and couldn’t find a solution so I thought may be this solution may help somebody in the future/ Thanks again.
After upgrading client and server to Buzzard, I am seeing this behavior as well for
populate
.For some reason, { provider: ‘socketio’ } is coming in on options.schema even though this particular
populate
originated out-of-band from an RxJs subscription that processes messages on a queue. Error is ‘No auth token’Same issue if I initiate the flow via REST.
based on the feathers chat chatwithupload upload works. when you try to download it gives authentication error. stop node and run node and download works.