<GoogleLogin
clientId="id from google o auth "
render={(renderProps) => (
<Button className={classes.googleButton} color="primary" fullWidth onClick={renderProps.onClick} disabled={renderProps.disabled} startIcon={<Icon />} variant="contained">
Google Sign In
</Button>
)}
onSuccess={googleSuccess}
onFailure={googleFailure}
cookiePolicy="single_host_origin"
/>
const googleSuccess = async (res) => {
const result = res?.profileObj;
const token = res?.tokenId;
try {
dispatch({type: "AUTH", data: {result, token}})
history.push("/");
} catch (error) {
console.log(error)
}
}
const googleFailure = () => {
console.log("Google Login Failure...")
在 netlify 上部署时,google oAuth 出现错误。我已经在 Google Console Api 凭据中添加了 URL 和重定向,但是每次按下按钮并点击任何电子邮件时,仍然有 onFailure 功能正在运行......