简体   繁体   中英

How to hide Firebase API in Vanilla JavaScript?

Hope you're having a good day.

I was working on a project where I am making a user input form with HTML, JavaScript but when I inspect using Google Chrome, the front-end codes are showing up. All of my firebase Realtime Database API, Key, everything is there, visible.

I was wondering, if I make a login/sign up page using firebase and JavaScript, someone will be able to steal this database API and create their own HTML form, submit information and then they come back to my site and directly login with what they have, right?

Is there possibly any way (without React.js.env method) to prevent users from stealing my firebase API codes?

I did it on my own. If you're looking for the solution, I just kept the API KEY in my php code, then called it inside my Javascript code, that's it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM