@react-oauth/google google登录不返回access_token

问题描述 投票:0回答:1
reactjs authentication google-signin
1个回答
0
投票

使用 useGoogleLogin 而不是 GoogleLogin 这是代码

<button onClick={() => login()}>Sign in with Google 🚀 </button>
  const login = useGoogleLogin({
    onSuccess: (codeResponse) => setUser(codeResponse),
    onError: (error) => console.log("Login Failed:", error),
  });
© www.soinside.com 2019 - 2024. All rights reserved.