mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.55k stars 100 forks source link

"Missing login token" for attempt to access admin page via proxy #151

Closed naturalethic closed 5 months ago

naturalethic commented 6 months ago

I proxy my admin page through the web server, mapping admin.mydomain.etc to localhost/admin, however, when I put my admin password in, I get a javascript alert with the message 'Missing login token'.

Access admin via SSH tunnel, however, works fine.

mjl- commented 6 months ago

Are you accessing the url at admin.mydomain.example without path, e.g. https://admin.domain.example/ vs http://localhost/admin/?

The mox cookies are scoped to paths like /admin/, /account/ and /webmail/. While it's normal for reverse proxies to modify http request paths while modifying, I don't think they typically fix paths in returned cookies.

If this is indeed the reason you're getting the error, then not stripping the path on forward, and accessing https://admin.domain.example/admin/ may be a workaround.

naturalethic commented 5 months ago

Yep, if I use the path it works. Ok, this is fine. Thanks!

mjl- commented 5 months ago

i added a hint for this case, should hopefully prevent future confusion with others. thanks for reporting! closing this now, feel free to reopen if we can do more.