File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,20 +15,22 @@ const missingFirebaseEnv = requiredFirebaseEnv.filter(
1515) ;
1616
1717if ( missingFirebaseEnv . length > 0 ) {
18- const message = `Configuration error: missing environment variables (${ missingFirebaseEnv . join (
18+ // Keep the detailed message out of the DOM to avoid exposing
19+ // internal environment variable names to end users.
20+ const devMessage = `Configuration error: missing environment variables (${ missingFirebaseEnv . join (
1921 ', '
2022 ) } ). The site owner needs to add these in the hosting dashboard.`;
2123
2224 // React hasn't mounted yet at this point, so we write directly to the DOM
2325 // to avoid leaving the user with a silent blank white screen.
2426 document . body . innerHTML = `
2527 <div style="font-family: sans-serif; max-width: 480px; margin: 80px auto; padding: 24px; text-align: center; color: #333;">
26- <h2 style="color:#c0392b;">Something's misconfigured </h2>
27- <p>${ message } </p>
28+ <h2 style="color:#c0392b;">We're currently unavailable </h2>
29+ <p>This application is temporarily unavailable due to a configuration issue. Please try again later or contact support. </p>
2830 </div>
2931 ` ;
3032
31- throw new Error ( message ) ;
33+ throw new Error ( devMessage ) ;
3234}
3335
3436const firebaseConfig = {
You can’t perform that action at this time.
0 commit comments