Repository navigation
Closed
Description
[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 [email protected] 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 [email protected] hosting:channel:deploy zzz --only site1 --expires 7d --project proj --debug
...
$ npx [email protected] hosting:channel:deploy zzz --only site2 --expires 7d --project proj --debug
...now both sites shows in the firebase console.
Now if I rerun:
$ npx [email protected] hosting:channel:deploy zzz --expires 7d --project proj --debugthe 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
google-oss-bot commentedon Sep 12, 2023
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
yellowhat commentedon Sep 25, 2023
@bkendall do you require any other information?
bkendall commentedon Oct 17, 2023
I'm not able to replicate this (either on
12.5.3or12.7.0). I've attempted several times, but both sites get added to authorized domains every time.It almost sounds like you're seeing a caching issue in the console? If you hard-refresh the console page, does the domain show up after that?
It does look like the API call is right, especially if you're seeing the domains get added there; that's why I think it might just be something in the console (and you didn't mention that you ran into this issue from auth not working, another point in favor of maybe just a visualization issue)
(And sorry for the delay - I've got a bit on my plate on the moment, so I appreciate your patience)
yellowhat commentedon Oct 18, 2023
Thanks for your reply.
I have just tried again:
If I go to firebase console > Authentication > Settings > Authorized domains, still only
site0--test-testshows, notsite1--test-test.Infact if I go to the second site url (https://site1--test-test.web.app) and try to login using google, in the browser console I get:
Is there other information I can provide to help you replicate it?
bkendall commentedon Oct 25, 2023
Since I can't replicate it, I think I'd need the full
--debuglogs to really see what's going on. It looks like some update isn't sticking, but I don't know if it's the CLI logic that's failing, or the API that's not accepting it.The best way to get us logs is probably be to file a ticket with Firebase support for Hosting and you can reference this ticket and let them know I asked for more information, and they should forward it onto our team.
yellowhat commentedon Oct 25, 2023
Thanks for the reply.
Just raised the ticket.