aqualinkorg / aqualink-app

Aqualink.org Ocean Monitoring Application
MIT License
34 stars 12 forks source link

Fix functions would not read SOFAR_API_TOKEN #868

Closed echaidemenos closed 1 year ago

echaidemenos commented 1 year ago

Fixes a bug where in some cases functions would not read SOFAR_API_TOKEN.

The issue was that export const { SOFAR_API_TOKEN } = process.env; in constants.ts would run before process.env.SOFAR_API_TOKEN = functions.config().sofar_api.token; in cloud-functions/index.ts causing imported SOFAR_API_TOKEN to be undefined.