We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00c963b commit 916770fCopy full SHA for 916770f
.changeset/early-elephants-learn.md
@@ -0,0 +1,5 @@
1
+---
2
+"@firebase/auth": patch
3
4
+
5
+Add a validation for useEmulator URL.
packages/auth/src/auth.js
@@ -299,6 +299,11 @@ fireauth.Auth.prototype.useDeviceLanguage = function() {
299
fireauth.Auth.prototype.useEmulator = function(url) {
300
// Emulator config can only be set once.
301
if (!this.emulatorConfig_) {
302
+ if (!/^https?:\/\//.test(url)) {
303
+ throw new fireauth.AuthError(
304
+ fireauth.authenum.Error.ARGUMENT_ERROR,
305
+ 'Emulator URL must start with a valid scheme (http:// or https://).');
306
+ }
307
// Emit a warning so dev knows we are now in test mode.
308
this.emitEmulatorWarning_();
309
// Persist the config.
0 commit comments