hoodie-server icon indicating copy to clipboard operation
hoodie-server copied to clipboard

store/pre-auth-hook: error if no session token sent

Open gr2m opened this issue 8 years ago • 3 comments

If a request has no session token, then we do return reply(Boom.unauthorized()), but that only calls the next .then callback and sets session in it to Boom.unauthorized().

We have to throw an error instead and set error.status to 404 so that the .catch callback can take care of it

gr2m avatar Dec 22 '16 06:12 gr2m

A corollary to this is the other line from the same function that does return reply.continue(), also resulting in an erroneous call to the next handler in the promise chain.

minrwhite avatar Jan 04 '17 16:01 minrwhite

I think this is resolved as part of #526, see the comment at https://github.com/hoodiehq/hoodie-server/pull/526/files#diff-0c9cbe67579a94330b4f853044a4717dR43. Can you confirm that?

gr2m avatar Jan 05 '17 19:01 gr2m

Yes, this is indeed now resolved, though the test suite is still throwing out a warning as a result of jupiter/simple-mock#22. I'll update the above PR to fix this only.

minrwhite avatar Jan 06 '17 11:01 minrwhite