Skip to content

addAuthDomains does not add multiple domains #6356

Description

@yellowhat

[REQUIRED] Environment info

firebase-tools: 12.5.3

Platform: Ubuntu

[REQUIRED] Test case

Hi,
we have multiple sites defined in our .firebaserc, ie:

{
  "projects": {
    "default": "proj"
  },
  "targets": {
    "proj": {
      "hosting": {
        "site1": [
          "site1"
        ],
        "site2": [
          "site2"
        ]
      }
    }
  }
}

[REQUIRED] Steps to reproduce

If I deploy to a channel:

$ npx firebase-tools@12.5.3 hosting:channel:deploy zzz --expires 7d --project proj --debug
...
[2023-09-12T15:58:19.040Z] <<< [apiv2][body] PATCH https://identitytoolkit.googleapis.com/admin/v2/projects/proj/config
{
    "name": "projects/123/config",
    "signIn": {
        "email": {
            "enabled": true
        },
        "hashConfig": {
            "algorithm": "SCRYPT",
            "signerKey": "key",
            "saltSeparator": "Bw==",
            "rounds": 8,
            "memoryCost": 14
        }
    },
    "notification": {
        "sendEmail": {
            "method": "DEFAULT",
            "callbackUri": "https://proj.firebaseapp.com/__/auth/action",
            "dnsInfo": {
                "customDomainState": "NOT_STARTED",
                "domainVerificationRequestTime": "1970-01-01T00:00:00Z"
            }
        },
        "sendSms": {
            "smsTemplate": {
                "content": "%LOGIN_CODE% is your verification code for %APP_NAME%."
            }
        },
        "defaultLocale": "en"
    },
    "quota": {},
    "monitoring": {
        "requestLogging": {}
    },
    "multiTenant": {},
    "authorizedDomains": [
        "localhost",
        ...
        "site1-random--zzz-p74ozsma.web.app",
        "site2-random--zzz-yehbjsw1.web.app"
    ],
    "subtype": "FIREBASE_AUTH",
    "client": {
        "apiKey": "key",
        "permissions": {},
        "firebaseSubdomain": "proj"
    },
    "mfa": {
        "state": "DISABLED"
    },
    "blockingFunctions": {},
    "smsRegionConfig": {}
}
[2023-09-12T15:48:54.800Z] [hosting] added auth domain for urls ["https://site1-random--zzz-yehbjsw1.web.app","https://site2-random--zzz-yehbjsw1.web.app"]

the logs says that 2 domains have been added but the firebase console, "Authorized domains", shows only the first site.

Instead if I deploy each site separately:

$ npx firebase-tools@12.5.3 hosting:channel:deploy zzz --only site1 --expires 7d --project proj --debug
...
$ npx firebase-tools@12.5.3 hosting:channel:deploy zzz --only site2 --expires 7d --project proj --debug
...

now both sites shows in the firebase console.

Now if I rerun:

$ npx firebase-tools@12.5.3 hosting:channel:deploy zzz --expires 7d --project proj --debug

the second site disappear from the "Authorized domains" list.

[REQUIRED] Expected behavior

Both sites are in the "Authorized domains" list

[REQUIRED] Actual behavior

Only 1 site is in "Authorize domains" list

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions