Closed pankajVayuz closed 11 months ago
please tell me further, your code or any screenshot
@cuongdevjs I provide you screenshots why are you not resolving my issue?
I will like to add to this question since I'm also experiencing this issue. My Google login button was working perfect since April and suddenly stop working a few days ago for unknown reasons.
This is my code:
import {LoginSocialFacebook, LoginSocialGoogle } from 'reactjs-social-login'
import {FacebookLoginButton, GoogleLoginButton } from 'react-social-login-buttons'
.................
const handlerSocialMediaLogin=useCallback((data,provider)=>{
console.log(data) --> data retrieving for Facebook but not Google
console.log(provider) --> prints out correct, either Facebook or Google
.......
},[])
return(
............
<LoginSocialFacebook
appId={process.env.REACT_APP_FACEBOOK_APP_ID}
fieldsProfile={ "id,first_name,last_name,middle_name,name,name_format,picture,short_name,email" }
onLoginStart={handlerFacebookLogin}
onLogoutSuccess={handlerFacebookLogout}
redirect_uri={null}
onResolve={({provider,data})=>{ handlerSocialMediaLogin(data,provider) }}
onReject={(err) => {
console.log(err);
}}
// isOnlyGetToken
>
<FacebookLoginButton className={styles.socialBtns} />
</LoginSocialFacebook>
<LoginSocialGoogle
client_id={process.env.REACT_APP_GOOGLE_APP_ID}
onLoginStart={handlerFacebookLogin}
redirect_uri={null}
scope="openid profile email"
discoveryDocs="claims_supported"
access_type="offline"
onResolve={({provider,data})=>{ handlerSocialMediaLogin(data,provider) }}
onReject={err => {
// console.log(err);
}}
>
<GoogleLoginButton className={styles.socialBtns} />
</LoginSocialGoogle>
The login prompt is displaying correctly as follows:
When I console.log(data)
in handlerSocialMediaLogin
method for Facebook I'm getting the user's email, full name and access token. However when I do the same with Google, I'm now getting the following:
It was working perfectly before (until a few days ago), I'd get the user's email, full name and access token however now I'm not getting these details and I have not changed anything in my code. Any help will be appreciated.
Version: "react-social-login-buttons": "^3.9.1", "reactjs-social-login": "^2.6.2",
Browsers: Chrome, Edge
Desktop: OS: Windows 10 Browser : Chrome Version : 117.0.5938.92 (Official Build) (64-bit) Browser : Edge Version : 117.0.2045.43 (Official build) (64-bit)
Smartphone: Device: One Plus 6 (A6000) OS: Android, Oxygen OS version, 11.1.2.2 Browser : Chrome Version : 117.0.5938.60
@drattansingh please try to upgrade to the newest version, 2.6.3
The old implementation is deprecated by Google, and the new mechanism GSI must be applied following Google's recommendation.
Is there any change in the code for the newest version?
I updated to the newest version and my code follows online_demo but I'm still getting the same error when console.log(data)
:
"react-social-login-buttons": "^3.9.1",
"reactjs-social-login": "^2.6.3",
I got it working. I updated to version 2.6.3 and modified my access_type like so:
access_type="online"
Thanks for your help
Describe the bug google social media log in not working .
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.