reactjs - 如何使用“react-google-login”工具与“profileObj”和“tokenObj”并行获取 Google 身份验证代码?
问题描述
我正在使用react-google-login ( https://www.npmjs.com/package/react-google-login ) 工具通过 Google 登录。有一些问题:
- GoogleLogin 给了我两种类型的对象:
profileObj
和tokenObj
. 在'tokenObj'中我可以得到access_token
等等。 - 如果我使用
accessType = 'code'
我可以得到auth_code
. 但这阻止了我得到profileObj
andtokenObj
。 - 文档说如果使用
accessType = 'permission code'
,那么我可以同时获得tokenObj
和auth_code
。但它不是真的。这没有发生。
现在我想同时获得tokenObj
和auth_code
。
真的可以这样做吗?我怎样才能得到与andauth_code
并行的?profileObj
tokenObj
解决方案
推荐阅读
- php - laravel中数组验证下的验证
- python - 在 PySpark 中加入两个具有空值的数据帧时出现问题
- javascript - Angular 6:如何访问 mat-autocomplete 下拉列表中的所有选项值?
- django - django/celery 多个队列不消耗任何任务
- exception - Xamarin 表单:在 UWP 中使用 displayactionsheet 时出现异常(Android 部分工作正常)
- javascript - 点击函数没有在循环函数之外命中
- php - 创建新页面而不创建新文件
- android - 存储单个字符串的内容提供程序
- .net-core - 是否可以使用一个共享框架发布多个自包含的 .Net Core 应用程序
- indexing - Solr 索引文档很晚