Redirect_to in shortcode not working
-
Hi,
The plugin works great, however I can’t seem to get the “redirect_to” parameter to work in the shortcode. I’ve made sure to disable any redirect plugins, but no matter what I do, I end up on the login page after logging in. Please help?
-
@lazerfloyd Thanks for reporting this. Looks like a regression issue from a recent release. We’ll get a fix out shortly.
Release v1.4.1 fixes this issue ^
Awesome, thank you so much! Confirmed to be fixed on my end.
I’m using all default and it is a fresh install, redirect shortcode is not working no matter what, any idea how to fix this?
Login with Google Version 1.4.1
WP Version 6.8.3Thanks
@pakey Thanks for reaching out.
I just tested the redirect shortcode on my setup and couldn’t reproduce the issue you mentioned.
Can you please share details of the exact shortcode you added, where it was added and redirection destination?
I look forward to hearing from you
It works now, maybe cache, but OneTap Login is still not working, button works well
Thanks for getting back to me and sharing the older issue is resolved.
Regarding the OneTap login:
Can you please confirm the browser in use? Also, can you share the details I requested earlier? This will help me re-create the same enviroment to test the issue out at my end
I look forward to hearing from youI’m using chrome with a default shortcode;
[google_login button_text=”Google Login” force_display=”yes” /]
It show this error in the One Tap Login;Can’t continue with google.com
Something went wrong
@pakey Thanks for getting back to me. I apologize for the back and forth.
Can you please open your browser developer console, retry the one tap and and share the error details with me? There should be some extra details logged within your browser.
I look forward to hearing from you.I enabled the Google Chrome AI to check it, here it is;
It appears the “one tap login error” is primarily due to the Google Identity Services client library (gsi.js) not being loaded or initialized correctly. The <code class=” “>g_id_onload element is present in the DOM with a client ID, but the necessary JavaScript functions from the Google library are not available.
Here are the potential causes and solutions:
- <strong class=” “>gsi.js script not loaded: The most common reason for this error is that the Google Identity Services JavaScript library (<code class=” “>https://accounts.google.com/gsi/client) is not being loaded on the page.
- <strong class=” “>Solution: Ensure that the <code class=” “><script async defer src=”https://accounts.google.com/gsi/client”></script> tag is present in the <code class=” “><head> or at the beginning of the <code class=” “><body> of your HTML document. It should load before the <code class=” “>g_id_onload div and any related JavaScript calls.
- <strong class=” “>Script loading order: Even if the script tag is present, if other scripts are blocking its execution or if the <code class=” “>g_id_onload element or any related JavaScript tries to access <code class=” “>google.accounts.id before <code class=” “>gsi.js has fully loaded, it can lead to this error.
- <strong class=” “>Solution: Place the <code class=” “>gsi.js script tag as early as possible in your <code class=” “><body> or <code class=” “><head>, ideally with <code class=” “>async and <code class=” “>defer attributes. Ensure any custom JavaScript that initializes Google One Tap is executed only after the <code class=” “>gsi.js library has loaded (e.g., within a <code class=” “>window.onload event listener or by placing the script at the end of the <code class=” “><body>).
- <strong class=” “>Network issues or ad blockers: Occasionally, network connectivity problems or browser extensions like ad blockers can prevent <code class=” “>gsi.js from loading.
- <strong class=” “>Solution: Check the browser’s Network tab in DevTools to confirm <code class=” “>gsi/client is loading successfully (HTTP 200 status). Temporarily disable browser extensions to rule out ad blockers.
- <strong class=” “>Client ID mismatch or misconfiguration: While the client ID was present, double-check that it is the correct one for your Google Cloud project and that the “Authorized JavaScript origins” in your Google Cloud Console are correctly configured to include your website’s URL.
- <strong class=” “>Solution: Verify the <code class=” “>data-client_id value against your Google Cloud project credentials. Ensure <code class=” “>https://mywebsite.org (or the appropriate origin for your login page) is listed in “Authorized JavaScript origins.”
To investigate further and potentially fix this, let’s check if the <code class=” “>gsi.js script is present in the DOM.
So I add URI under the ‘Authorized JavaScript origins’ (ex; https://mywebsite.org) and it works well so far. I’ll do more testing.
Just for info, I’m unable to locate instructions in the rtCamp GitHub repository regarding where to enter the ‘Authorized JavaScript origins’. I wasn’t aware this was a required step, and I genuinely didn’t see it mentioned in the existing documentation. My apologies if I simply overlooked it! 🙂
@pakey
Thanks for letting me know it’s now working.
The javascript origin is actually a part of the README below the Usage instructions heading:You will need to register a new application at https://console.cloud.google.com/apis/dashboard
Authorization callback URL should be like https://yourdomain.com/wp-login.php and the Authorized JavaScript origins should be like https://yourdomain.com where https://yourdomain.com will be replaced by your site URL.
More info here:
https://github.com/rtCamp/login-with-google?tab=readme-ov-file#shortcode:~:text=Authorization%20callback%20URLHowever, you’re correct that our documentation needs to be clearer. I’ve raised the concern internally on making things easier to check when you experience an error; its likely cause and possible fixes.
Thanks for sharing your insights.
- <strong class=” “>gsi.js script not loaded: The most common reason for this error is that the Google Identity Services JavaScript library (<code class=” “>https://accounts.google.com/gsi/client) is not being loaded on the page.
The topic ‘Redirect_to in shortcode not working’ is closed to new replies.