Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

secrets.js api keys not being integrated #381

Closed
ShelleySuhling opened this issue Jun 8, 2018 · 4 comments
Closed

secrets.js api keys not being integrated #381

ShelleySuhling opened this issue Jun 8, 2018 · 4 comments

Comments

@ShelleySuhling
Copy link
Contributor

I keep getting errors regarding missing api keys even when keys are added to server/config/env/secrets.js.

This is the error I get when navigating to path drivers/list:
Google Maps JavaScript API error: MissingKeyMapError

My secrets.js file looks like this:
gmapsApiKey: process.env.GMAPS_API_KEY || 'API KEY HERE', replacing "API KEY HERE" with my personal google maps api key

I have been able to get the api to work when directly adding the key to the file Maps.js

Anyone else having this issue? Or know how I can fix it locally?

@kenjiO
Copy link
Contributor

kenjiO commented Jun 8, 2018

Can you try adding console.log('gmapsApiKey is: ' + config.gmapsApiKey) to the end of the file server/server.js. Then try npm run dev and check the console to verify that it is picking up your API key from the config file. If it is picking up your key can you post the error you get in your browser console.

@jspaine
Copy link
Contributor

jspaine commented Jun 8, 2018

Sorry about that, this needs fixing somehow. The easiest was to add it for now is at the bottom of the general settings page.

The reason it's like that is the key is needed on the client (also not ideal) so it's kept in the database. And it's added there while seeding so doesn't get picked up from the environment after you've run it for the first time.

Opened #382 to track this

@ShelleySuhling
Copy link
Contributor Author

Oh I had no idea that was even there! Could I make a PR updating the documentation?

@jspaine
Copy link
Contributor

jspaine commented Jun 8, 2018

Yeah that would be good, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants