Skip to content

Commit

Permalink
Firebase settings env
Browse files Browse the repository at this point in the history
  • Loading branch information
jennymar committed Jun 1, 2024
1 parent b394e55 commit a62c2a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/admin/firebase/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type FirebaseServices = { auth: Auth; storage: FirebaseStorage };
*/
export const initFirebase = (): FirebaseServices => {
if (!env.NEXT_PUBLIC_FIREBASE_SETTINGS) {
throw new Error("Cannot get firebase settings");
throw new Error("Cannot get firebase settings. " + process.env.NEXT_PUBLIC_FIREBASE_SETTINGS);
}

const firebaseConfig = env.NEXT_PUBLIC_FIREBASE_SETTINGS as FirebaseOptions;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/admin/util/validateEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { cleanEnv } from "envalid";
import { str } from "envalid/dist/validators";
import { str, json } from "envalid/dist/validators";

Check warning on line 7 in frontend/src/app/admin/util/validateEnv.ts

View workflow job for this annotation

GitHub Actions / Frontend check

Member 'json' of the import declaration should be sorted alphabetically

/**
* NextJS only allows the frontend to access environment variables if they start with
Expand All @@ -19,7 +19,7 @@ export default cleanEnv(
},
{
NEXT_PUBLIC_BACKEND_URL: str(), // URL of our backend
NEXT_PUBLIC_FIREBASE_SETTINGS: str(), // Firebase settings for frontend
NEXT_PUBLIC_FIREBASE_SETTINGS: json(), // Firebase settings for frontend
NEXT_PUBLIC_PAYPAL_CLIENT_SECRET: str(),
NEXT_PUBLIC_PAYPAL_CLIENT_ID: str(),
},
Expand Down

0 comments on commit a62c2a9

Please sign in to comment.