heroiclabs / nakama

Distributed server for social and realtime games and apps.
https://heroiclabs.com
Apache License 2.0
9.01k stars 1.1k forks source link

Nakama console requires reauthentication every time the project rebuilds #945

Closed IanCodeWizards closed 1 year ago

IanCodeWizards commented 1 year ago

Description

As of Nakama 3.13.X, every time the project rebuilds it requires the user to reauthenticate. Previously on <=3.12.x, this wasn't the case and it was useful when having a project that hot reloads whilst developing. It's become a bit of a pain having to type in the username and password and navigate back to where you were in the console to test rpcs etc.

Steps to Reproduce

  1. Log in to the nakama console on >=3.13.x
  2. Rebuild project
  3. Reopen project

Expected Result

User does not have to log in every time project rebuilds

Actual Result

User does have to log in every time project rebuilds

Your Environment

delasource commented 1 year ago

I did set up my build tool to restart the docker after any file change, which works perfectly. But the invalid login is extremly annoying!

i think this is because of https://github.com/heroiclabs/nakama/issues/658

By the way, this is what i use: rollup -c -w --watch.onEnd "docker compose restart nakama" And in rollup.config.js under output: file: '../docker_data/modules/index.js', (everything else is according to documentation)

delasource commented 1 year ago

i spend the whole day trying to work around this. I now took a fork, added a yml option to completly disable the session_cache functionality (although i understand its purpose), created a docker image out of this and use that in my docker-compose file now. Which is fine for now.

maciejmrozinski commented 1 year ago

We're facing the same issue. Valid JWT tokens are discarded after restart, which destroys the whole purpose of using them. JWT tokens should be allowed at least until they are not expired and signing key is validated properly.

delasource commented 1 year ago

in the past i added a configuration option for this. i did not yet have time to create a PR. But the relevant code you can find here https://github.com/heroiclabs/nakama/commit/08b22ee068bbf0112281a9245dcabab3d86da2d6

zyro commented 1 year ago

Handled in Nakama v3.18.0. 🙇