I have a NextJS app being hosted with the new Firebase App Hosting. I’ve set up the apphosting.yaml
and linked my secrets to those in the google cloud secret manager. Consent screen is set up and able to successfully sign in using Next Auth Google sign in.
The issue is with the Google Cloud OAuth2 credential. I created a credential that initially only had http://localhost:3000
in the Authorized Authorized JavaScript origins & Authorized redirect URIs. This was fine for development and worked great.
Then I moved on to trying to set up Firebase Cloud Messaging. As it only works on https, I figured I’d push to prod to get all of that figured out and try testing it there, so I can actually see what messages look like when they come in on a mobile device. I updated the OAuth2 credential and added in the prod origin & redirect URI’s.
This was done last night, in case the warning about 5 minutes to several hours to take effect would cause any issues. Well, it doesn’t seem to care that I added in the new Origin/URI, as no matter what I do, using an incognito browser, Firefox, Firefox Incognito, it is only ever redirecting to the localhost URI, so attempting to sign in on the prod environment always fails.
So I tried to delete the localhost origin/URI so that it only had the prod one active. That didn’t work.
So I deleted the credential and created a new one. Updated secrets locally & in the secret manager to use the new credential. Added in both prod/dev info. It still only redirects to localhost. So I deleted Google’s access to my app in hopes that starting fresh on all accounts would force it to use the correct URI. Still no luck.
I’m at a loss for what to do at this point. It refuses to use anything other than localhost for redirects, which is breaking my prod environment.