Wouldn’t implement a token-based auth system solve this?
Like, when the user logs in using their credentials, a web token is returned. And this web token would consist of a header, payload, and signature.
Than, you use the token to make requests to DB Proxy, like, every time the game makes a request to the database, it includes the token in the header.
And after that The DB proxy receives the request and verifies the token by decoding it using the same secret key used to encode it.
Can’t just you know create a separate server in replit?
And like, this server will have the token stored in an environment variable (Secrets).
And when the game needs to make a request to the database, it sends a request to this separate server instead of directly to the database.
Than, the separated server receives the request from the game, attaches the database access token to it, and sends it to the database. The database will process this request and send the response back to the separated server. With the response it forwards back to the game.
Wait, my head is starting to explode, let me catch a breath
I really recommend you don’t do that cause then the project will be kept on hold for probably years. I might create a template of a website that looks like the Replit Console so you don’t have to do any work to just convert your Console Repl to a website so you can have a global DB.