hapijs / nes

WebSocket adapter plugin for hapi routes
Other
502 stars 87 forks source link

Properly set isAuthenticated from the auth object's status key. #274

Closed Invader444 closed 5 years ago

hueniverse commented 5 years ago

The auth object has no status property...

For future contributions, please describe what you are trying to solve and add a test to show the problem.

Invader444 commented 5 years ago

But auth does have a status property, and it is used in the auth tests here: https://github.com/hapijs/nes/blob/4cbf8adeacda68bef717874dfb2bc5d8251b9a57/test/auth.js#L101

Unfortunately, since v10 nes has not allowed for unauthenticated connections to endpoints with optional auth. The reconnect always assumes its authenticated with the hardcoded true, and sends credentials that do not exist.

Please re-open this PR.

hueniverse commented 5 years ago

You are confusing two completely different things. The status is coming from the authentication endpoint result:

https://github.com/hapijs/nes/blob/master/lib/index.js#L203

This has nothing to do with the auth object set in the cookie or sealed object here:

https://github.com/hapijs/nes/blob/master/lib/index.js#L193

If you want to submit a PR with failing tests that show a problem, please do.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.