hapijs / yar

A hapi session manager
Other
133 stars 59 forks source link

Support nes #132

Closed Slayug closed 4 years ago

Slayug commented 5 years ago

Hello, I'm using Yar for my endpoints and works fine, but I also want to make it works with Nes through websockets and recover same users I set in my endpoint. Yar object is present into my request object when using Nes route:

// Route subscribed with Nes
this.route({
            method: 'POST',
            path: '/{id}/toast',
            config: {
                handler: function(request, h) {
                    console.log('toast posted:', request.yar._store)

But the store is always empty, event if I set something into it. I looked a bit the code, it seems Nes is executed before Yar, its not on same level.

Is there a way to make Yar available with Nes routes ?

hueniverse commented 5 years ago

It will require special handling in yar to store the session information on the socket instead of as a cookie.

lloydbenson commented 4 years ago

@Slayug: it looks like this is unlikely to happen without community effort. I am closing this up, but I think we'd be open to a PR later if you find time!