javascript - 脸书 API。签名请求-> {user_id,代码}
问题描述
非常主题。有API。通过前面获取身份验证
async function checkLoginState(response) {
window.fbAsyncInit = function() {
FB.init({
appId : 'X',
cookie : true,
xfbml : true,
version : 'v11.0'
});
};
FB.getLoginStatus(function(response) {
console.log(response);
return response;
});
}
然后解码:
async function decode() {
console.log(window.atob(resp.authResponse.signedRequest.split('.')[1]));
return;
}
最后有两个值的json。user_id
还有一些code
。如何通过该代码部分检查此 user_id 是否有效?(512+ 符号 ASCI)。脸书保持沉默……
不要为 async\promises 的错误编码而烦恼。试图检查选项=)
解决方案
推荐阅读
- javascript - 错误类型错误:无法读取未定义的属性“audioPlayer”
- lua - 按名称从表中解压缩几个 lua 字段
- node.js - nodemon 使用带有打字稿的 express
- javascript - 如何在一个循环中获得多个 json 输出?
- azure - 更新 Azure KeyVault
- ios - Rootview 控制器不适用于标签栏控制器 Swift 4.2
- python - 与 Databricks 笔记本中的 blob 存储文件交互的过程
- docker - 为每个容器分配 CPU
- python - 如何将 key:value 添加到 empy dict 中,其值超过 1 个项目
- python - 合并数据框中的 2 列