Google Login Integrartion

Highlighted
Shopify Partner
4 0 0

I have integrated Google sign-in on my web-app. It is successfully authenticating the user via google API. Now, after the successful validation, I want it to redirect to my homepage. That's where I am having a problem. Grabbing the right element to redirect from my login page. Liquid language is a bit of hindrance here, expecting some help. Below is the piece of code I am using:

That's including Goggles API with my client ID:
   <meta name="google-signin-client_id" content="367187722399-792ee32hm5km37sovicokrj4jpmu3l14.apps.googleusercontent.com">
    <script src="https://apis.google.com/js/platform.js" async defer></script>

That's the script handling data fetch:

<script>
      function onSignIn(googleUser) {
    	var profile = googleUser.getBasicProfile();
    	var idToken = googleUser.getAuthResponse().id_token;
		}

	  function onSignOut(){
    	var auth2 = gapi.auth2.getAuthInstance();
    	auth2.signOut();
		}
    </script>

Thats the div tag for button:
<div id="google-signin-button"
     			class="g-signin2"
     			data-width="170"
     			data-height="30"
     			data-onsuccess="onSignIn"
     			data-onfailure="onSignInFailure">
        </div>

 

 

0 Likes
Highlighted
New Member
1 0 0

Hello,

I am also trying to integrate Google and Facebook to shopify store so that Users can directly login with their existing Google or Facebook acoount.

Can anyone please help me how to achieve it.

Thanks in advance.

Regards,

Amar

0 Likes