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

[FR] Add check to verify if auth emulator host is valid #2881

Open
amalej opened this issue Mar 22, 2025 · 1 comment · May be fixed by #2882
Open

[FR] Add check to verify if auth emulator host is valid #2881

amalej opened this issue Mar 22, 2025 · 1 comment · May be fixed by #2882

Comments

@amalej
Copy link

amalej commented Mar 22, 2025

Is your feature request related to a problem? Please describe.
I accidentally used http://127.0.0.1:9099 instead of 127.0.0.1:9099 when setting FIREBASE_AUTH_EMULATOR_HOST.

Even though the emulator thew an error like below, it still took me a while to figure out what I did wrong 🤦 :

FirebaseAppError: Error while making request: getaddrinfo ENOTFOUND http. Error code: ENOTFOUND
    at C:\Users\PATH\firebase-admin-node\lib\utils\api-request.js:268:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (file:///C:/Users/PATH/auth.js:12:5) {
  errorInfo: {
    code: 'app/network-error',
    message: 'Error while making request: getaddrinfo ENOTFOUND http. Error code: ENOTFOUND'
  },
  codePrefix: 'app'
}

Describe the solution you'd like
Throw an error message indicating that http and https should not be included when setting FIREBASE_AUTH_EMULATOR_HOST. Found a similar logic in

if (firebaseStorageEmulatorHost.match(/https?:\/\//)) {
throw new FirebaseError({
code: 'storage/invalid-emulator-host',
message: 'FIREBASE_STORAGE_EMULATOR_HOST should not contain a protocol (http or https).',
});
}

Describe alternatives you've considered
N/A

Additional context
N/A

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

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

Successfully merging a pull request may close this issue.

3 participants