How to make app do auth login to custom domain

The app is logging into .firebaseapp.com to show the Google login. I want the app to go my domain and show branding during consent. How to do it with prototyper or otherwise? I have already setup authentication url and auth handler url in firebase/gcp oauth settings

I used this page Showing a custom domain during sign in  |  Identity Platform Documentation  |  Google Cloud to set the auth domain through env of firebase studio code.

NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=customDomain

this caused 404 on login since customDomain/__/auth doesnt exists. It only existing firebase hosting app.

based on option3 in Best practices for using signInWithRedirect on browsers that block third-party storage access  |  Firebase ,

Adding the redirect in next.config.ts did not work on restarting the app and trying to login.

async rewrites() {

return {

  fallback: \[

    { 

      source: '/\_\_/:path\*', 

      destination: 'https://<firebase-project-id>.firebaseapp.com/\_\_/:path\*' 

    },

  \],

}

},

};

export default withPWA(nextConfig);

Any ideas how to make it work?

Use auth templates and verify the custom domain.

Do you have a link for documentation or something for what you mean as auth template

Found the fix for App Hosting, check this link Reddit - The heart of the internet