Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't put key auth data in public config.js #631

Closed
tomByrer opened this issue Apr 27, 2016 · 7 comments
Closed

don't put key auth data in public config.js #631

tomByrer opened this issue Apr 27, 2016 · 7 comments

Comments

@tomByrer
Copy link

I think having config.js is a good idea, & should stay part of the git repo (eg not in .gitignore.

But correct me if I'm wrong, isn't the social login id & secret private information? So should they be in a separate file (eg secrets.js) & that file be added to .gitignore so people don't accidentally upload their secretes?

@langpavel
Copy link
Collaborator

Even better in environment variables or passed as command line arguments

@mchandleraz
Copy link

@langpavel in some instances, it's possible to see the arguments that were used when starting a process so environment vars aren't always the best answer. Not sure what's right here.

@koistya
Copy link
Member

koistya commented Apr 28, 2016

FYI, the config.js file is only used in server-side code, it might be a good idea to put something like this in it if (!process.env.BROWSER) { throw new Error(..); } just to make sure that it's not referenced in client-side code by accident. A PR with this feature is welcome!

And if you need to extract some data from this config for use in the client-side code, you can do it in server.js where you dehydrate application's state for re-use on the client.

@langpavel
Copy link
Collaborator

@koistya Good catch! I will prepare PR because I violate this myself.

@langpavel
Copy link
Collaborator

#633 Prevent config to be bundled in client

@tomByrer
Copy link
Author

I think koistya's solution is a good extra layer of prevention.
I was thinking about separating the sensitive keys config from the remaining config to 2 separate files, & .gitignore that key file. This helps prevents transfer, especially when someone merges from their system back into this repo ;)

@ulani
Copy link
Member

ulani commented May 27, 2021

@tomByrer thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.

NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.

@ulani ulani closed this as completed May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants