Pressing tab awkwardly placed a process.env call inside of my vanilla JS. I think it’s 'cause it’s not checking the Repl type and simply showing this on any JS file that just had a key pasted.
This is one of those things that will probably only happen once, but still weird that it happened at all, and probably not expected functionality.
It even let me type a name for the Secret in a nice popup, though I don’t know where/if/how it stored it, especially since it’s an HTML, CSS, JS Repl and not a Node.js one.
@boston2029 I think this may be on purpose.
I remember putting some long URL into a HTML or Node repl (can’t remember), and it told me that there was some secret key (the URL said ‘key’) in it, and asked if I wanted to store it in a URL.
I don’t think it is a bug.
All of the services which can be accessed with that key (auth, firestore, etc) have their own form of authorization. The only thing you can do with access to an auth instance is, well, log yourself in and see your user data which you anyway have. Assuming your firestore rules are secure, the same applies to firestore. You should still only be able to access/modify data you have permission to.
I think the API key is there just to make it slightly harder for people to web scrape a bunch of firestore data or attempt to mass DDOS firebase. (For firestore, it’s easier for firebase to quickly deny a request without an API key than to actually evaluate the rules, reducing the impact of being DDOS’d)
It pastes it so awkwardly, like it removes the API key from the string, leaving it an empty string, and pastes it on a new line as the Secret. So strange.
And since this is probably intended to actually work on Node.js JavaScript files, then then it still needs to be fixed.