programsam / binkjs

Music archival site BINK, rewritten as a Node.js express app
0 stars 1 forks source link

Session detection on connect #49

Closed programsam closed 6 years ago

programsam commented 6 years ago

When you connect/load the in-browser app, it should check whether it is authenticated or not because that dictates its behavior.

programsam commented 6 years ago

This works now. Nginx has to be configured to pass the cookies with this block:

location / {
        proxy_pass http://localhost:3001;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

And then magically things were much better client side. There were some handling issues client side for the session, but it does seem that now it's sending the session identifier with all AJAX requests (YAY!)