Google Auth Not working in Production

I have my user dashboard at a site, There the Google login works both in Productiona and Development. I also made another app with the 1st one as its base for auth by setting baseURL for better auth client to the auth server url. All this setup was working fine locally.

But after deployment the login does not work in 2nd app. The Error is related to CORS as I have verofied that and made sure to set it properly.
I have also added Correct Authentications URLS in the google cloud console (Only one redirect URL although, of the 1st auth server).

The google login page opens but when it returns us to the page it is without proper cookies set for auth. Hence NO CHANGE !!!

Login Code
<script lang="ts">
  import { signIn } from '~/lib/auth-client';
  import Icon from '~/tools/Icon.svelte';
  import { GoogleIcon } from '~/components/icons';
</script>

<div class="mt-4 flex items-center justify-center">
  <button
    onclick={async () => {
      await signIn.social({
        provider: 'google',
        callbackURL: window.location.href
      });
    }}
    class="variant-outline-primary btn flex gap-2 rounded-lg font-semibold"
    ><Icon src={GoogleIcon} class="inline-block text-[1.25rem]" />Signin with Google</button
  >
</div>
Was this page helpful?