firebase / firebase/firebase-admin-node

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

オープン
#2,881 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: auth type: feature request
主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
3日 10時間
マージ済み PR(30日)
16

説明

**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 https://github.com/firebase/firebase-admin-node/blob/a46086b61f58f07426a6ca103e00385ae216691d/src/storage/storage.ts#L51-L56

**Describe alternatives you've considered**
N/A

**Additional context**
N/A

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。