How to protect the password for the admin login in my .json folder

Project URL: https://kg-agario.glitch.me
I have a game site that uses a .json file to store the password for the admin login. I have been using .gitignore for the past month to hide it but recently someone has been remixing the project and revealing the password in chat and abusing the admin rights which only I should have. I have been searching for a way to prevent them from being able to see the password but haven’t been able to figure out how to do so. I have tried looking into .env and .data but don’t understand how to use them. Can anyone help me? (Looking for a solution as soon as possible thanks!)

1 Like

Hi @Kronos8008, in case you haven’t seen our help doc about secrets, it goes a bit into how to use .env: How do I store secrets, credentials or private data? - Glitch Support

2 Likes

@jenn I saw that but couldn’t quite get that to work for my project. I’m open to letting someone look at my code and tell me how to implement the environmental variables though. :grinning:

What language are you using?

2 Likes

It looks like you are using node, you are going to have to tweak the argario code to not pull variables from the json file and instead the .env file.

2 Likes

@RiversideRocks OK, how do I copy what’s in the json file over to .env? Thank you for the help btw!