typio / recipow

Recipe web app
https://recipow.com
16 stars 0 forks source link

Hooks.ts getSession() doesn't execute in production #6

Closed typio closed 2 years ago

typio commented 2 years ago

It seems that SvelteKit trashes getSession() because of an issue with the redis var from db.ts

typio commented 2 years ago

In production: getSession() works fine if new Redis() fails to create connection

typio commented 2 years ago

Issue is actually caused by environment variables not being available in db.js when it is used by hooks.js, I think because getSession() is somewhat exposed to client and so the db.js gets blocked in some way.

typio commented 2 years ago

Issue is actually caused by environment variables not being available in db.js when it is used by hooks.js, I think because getSession() is somewhat exposed to client and so the db.js gets blocked in some way.

Probably wrong, getSession() still doesn't seem to be setting the session for client when all it does is set the sessionId from cookie.

typio commented 2 years ago

omfg its because the index.svelte had prerender=true from the default template, same thing as the other issue so stupid