相关疑难解决方法(0)

使用 Google One Tap 时,“suppressed_by_user”是什么意思?

我试图在用户时钟登录时点击一下出现,下面的代码在页面加载后立即运行时工作得很好,但如果我尝试让它在单击时运行,则会收到我不知道的错误suppressed_by_user错误没有运行广告拦截插件,我不知道这suppressed_by_user意味着什么?

\n\n

这里的文档详细介绍了该错误,但没有解释导致该错误的原因或如何修复该错误。

\n\n
<script src="https://accounts.google.com/gsi/client"></script>\n... \n  const signin = () => {\n    const handleCredentialResponse = (response: any) => {\n      const credential = response.credential;\n      const getDetails = async () => {\n        const params = new window.URLSearchParams({ credential });\n        const url = `${process.env.REACT_APP_API_BASE_URL}/google?${params}`;\n        const response = await fetch(url, { method: "GET" });\n        const data = await response.json();\n        setLoggedIn(true);\n        setState({ ...state, participant: data.participant });\n      };\n      getDetails();\n    };\n    if (state && state.participant && state.participant.id) {\n      setLoggedIn(true);\n    } else …
Run Code Online (Sandbox Code Playgroud)

javascript google-authentication reactjs

2
推荐指数
1
解决办法
3456
查看次数