Google One Tap integration causes 400 error in Magento 1.9 (OpenMage) with JS Prototype

45 Views Asked by At

I have an online store running on Magento 1.9 (OpenMage) and I want to integrate Google One Tap for a seamless login experience. The Google One Tap solution works perfectly fine when tested in a standalone HTML file. However, when I add the same code to my Magento theme, which is based on JS Prototype and some jQuery, it breaks and results in a 400 error.

The specific error I encounter is as follows:

Request URL: https://accounts.google.com/gsi/status Request Method: GET Status Code: 400

It appears that there might be a conflict between the Google One Tap library and the JS Prototype or other jQuery libraries used in my Magento theme.

Used jQuery.noConflict() to avoid conflicts between jQuery and Prototype. Loaded the Google One Tap library dynamically after the DOM has been created. Verified the data-client_id parameter for Google One Tap and ensured it is correctly set. Checked for any other JavaScript conflicts and errors in the browser console. Despite these efforts, the issue persists, and the Google One Tap login functionality does not work as expected.

I'm seeking assistance on how to properly integrate Google One Tap with my Magento 1.9 (OpenMage) theme that uses JS Prototype and jQuery without encountering the 400 error.

Any help or insights into resolving this conflict would be greatly appreciated. Thank you in advance!

0

There are 0 best solutions below