mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 22:52:58 +03:00
🐛 Bug Report: __HOST-access_token not being checked when determining login state
#385
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Snarkenfaugister on GitHub.
Reproduction steps
I have installed everything following the standalone installation instructions on a Debian 12 LXC.
Caddy is running in the container, issue occurs with both
CaddyfileandCaddyfile.trust-proxyconfigs.I also have a reverse proxy (nginx) configured to direct
https://pocketid.mydomain.comtohttp://{CONTAINER_IP}:80.This only happens on v0.27.1, and appears to be caused by #175.
Expected behavior
I'd expect that either
__HOST-access_tokenoraccess_tokenare used for auth.Actual Behavior
It looks like the
__HOST-access_tokencookie is being set on successful auth, but theaccess_tokencookie is being checked by the backend when determining auth status, instead of also checking the__HOST-access_tokencookie.I get a
Set-Cookie: __Host-access_token=***header set on successful auth, but am then redirected back to the login page on the/settings/__data.jsoncall.If I rename the
__HOST-access_tokencookie toaccess_token, everything works as expected.Version and Environment
Version
v0.27.1
frontend/.env
backend/.env
caddy
Also tried
Reverse Proxy
nginx
Log Output
@Snarkenfaugister commented on GitHub:
Ah, you're right, it looks like I'm not loading the frontend .env file properly.
Thanks for the help!
Unrelated, for the backend install/upgrade instructions I hit a snag because I didn't realise the
CGO_ENABLEDandGOOSenv vars needed to be set. Might be worth a comment for those.@stonith404 commented on GitHub:
Thanks for reporting this. I think the problem is that I've documented the wrong upgrade command in the docs.
Instead of
pm2 start build/index.js --name pocket-id-frontendcan you trypm2 start --name pocket-id-frontend --node-args="--env-file .env" build/index.jsto start the frontend?