Abdul Azij
Forum Replies Created
-
sorry to reopen this support. although this problem:
[28-Aug-2025 11:27:16 UTC] PHP Warning: Undefined array key "family_name" in /gyhftyht/public_html/wp-content/plugins/google-site-kit/includes/Modules/Sign_In_With_Google/Authenticator.php on line 256isn’t related to custom prefix. but it contains siwg module. this begun after updating to Site Kit Version 1.160.1
should i open a new thread?
oh i see.
thanks for doing that.
let’s hope we can have more features on sitekit specifically on sign in module.
as it still only have basic functionality.
If you were to disconnect their Google account, it may take more work and may not be possible to remove the sk- prefix if we were to add such a prefix for users registering with Sign in with Google.
i think this disconnect their Google account issue is more of a personal or case by case preference issue. example someone don’t like a prefix on their username etc. so it could be a optional option if site admin want to add a prefix or use wp default.
Would you like to see an open to assign a different role for Sign in with Google users specifically?
yes. a different role for Sign in with Google users specifically will be great.
i forgot to mention normal sign in with google.
yes both one tap+sign in with google button is same at least in my case. as i wants to have dedicated user role for them. so, for your questions answer:
No, prefix added to all generated usernames should happen, only if they are registered/login with a user use sitekit login/registration function including one tap.
so, it shouldn’t add prefix when user register using wp default/manual register process or simply a prefix shouldn’t be added to the Global registration process rather limited to sitekit specific registration. to understand who registered using Google sign in vs emails.
i saw GitHub repository yes that would be great for any administration for finding and sorting out active users.
i think you should add a way to sort list users who Signed in with Google.
in the meantime, can you tell me if sitekit add any user meta to Signed in with Google users? if yes which is?
also, if it’s possible to add/set a specific user’s role who use Signed in with Google/One tap will be great.
all right i had to add some code in functions.php now everything is going well.
but even if user is logged-in it still show One tap Prompts.
I had to use ChatGPT, Gemini is useless (I’m a text-based AI, and that is outside of my capabilities.)
here is the code now it’s working perfectly.
<!-- Sign in with Google button added by Site Kit -->
<script src="https://accounts.google.com/gsi/client"></script>
<script>
(() => {
// Store the current page URL
const currentPage = window.location.href;
async function handleCredentialResponse(response) {
try {
// Append the return URL as a query parameter
const params = new URLSearchParams(response);
params.append('redirect_to', currentPage);
const res = await fetch('https://www.viraltui.com/wp-login.php?action=googlesitekit_auth', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: params
});
if (res.ok && res.redirected) {
location.assign(res.url);
}
} catch (error) {
console.error(error);
}
}
google.accounts.id.initialize({
client_id: '7secretid.apps.googleusercontent.com',
callback: handleCredentialResponse,
library_name: 'Site-Kit'
});
google.accounts.id.prompt();
})();
</script>
<!-- End Sign in with Google button added by Site Kit -->Thank you for trying to help.
well i have been testing things my self.
here is the code that made my custom page Template Pages to show one tap sign in:
<!-- Sign in with Google button added by Site Kit -->
<script src="https://accounts.google.com/gsi/client"></script>
<script>
(()=>{async function handleCredentialResponse(response){try{const res=await fetch('https://www.viraltui.com/wp-login.php?action=googlesitekit_auth',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:new URLSearchParams(response)});if(res.ok && res.redirected){location.assign(res.url);}}catch(error){console.error(error);}}google.accounts.id.initialize({client_id:'mysecretzzzzzzzzid.apps.googleusercontent.com',callback:handleCredentialResponse,library_name:'Site-Kit'});google.accounts.id.prompt();})();
</script>
<!-- End Sign in with Google button added by Site Kit -->this code does let user login/sign up, but after login they redirect to /wp-admin/ instead of redirecting to the page where user login.
can you tell me if this code is all right to use?
Most importantly can you modify the code to redirect to same page where login occurred?
As for Recording, iam hoping i will be able to give that on Sunday (2nd February).
i don’t know why but i have this error lot’s time:
[30-Jan-2025 03:15:49 UTC] PHP Warning: Undefined array key "family_name" in /home/vv/public_html/wp-content/plugins/google-site-kit/includes/Modules/Sign_In_With_Google/Authenticator.php on line 261also, i forgot to mention that i use Wordfence Free version.
one question that has been bugging me for some time. console.log (F12) gives this error:
Uncaught ReferenceError: google is not defined
at 10d93dc397bb6d8364f2defff7230c2f.js?ver=a9888:16:351
at 10d93dc397bb6d8364f2defff7230c2f.js?ver=a9888:16:556upon checking and searching js file, i can see that:
;(()=>{async function handleCredentialResponse(response){try{const res=await fetch('https://www.viraltui.com/wp-login.php?action=googlesitekit_auth',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:new URLSearchParams(response)});if(res.ok&&res.redirected){location.assign(res.url)}}catch(error){console.error(error)}}google.accounts.id.initialize({client_id:'7myownid.apps.googleusercontent.com',callback:handleCredentialResponse,library_name:'Site-Kit'});google.accounts.id.prompt()})()could it be that My LiteSpeed Cache Plugin is compressing all .JS including Site kit required .JS file as well.
i have shared and filled out form.
sorry couldn’t attach a video. i am out of my home for few days, for personal work.
i can provide screen record, after i get back home. if still necessary.
i will try to deactivate my custom plugins to check if it’s making this problems.
i can confirm that,
twenty twenty five or default theme did show one tap login on Pages.
Could it be related to Astra Theme?
okay, thank you for your response.
i will wait for your results.
no, i used default page template.
Astra default page template.