vue.js - 如何使用 drf 和 vuejs 设置 github 身份验证?
问题描述
我按照本教程进行操作,并且能够为 github 创建视图:
如果我放置社交身份验证令牌,我可以检索原始令牌。我正在寻找在 vuejs 中实现这个过程的方法。我可以做类似的事情吗:
onGoogleSignInSuccess (resp) {
const token = resp.Zi.access_token
axios.post('http://localhost:8000/auth/google/', {
access_token: token
})
.then(resp => {
this.user = resp.data.user
})
.catch(err => {
console.log(err.response)
})
},
解决方案
推荐阅读
- lighting - 如何在eevee中实现硬阴影效果?
- javascript - Node.js:将请求选项转换为最终 URL
- javascript - 在 JavaScript 中有一种方法可以对多维数组中的元素进行求和,并根据数组中的其他元素分组
- hadoop - 将 Hadoop `FileStatus` 映射回 URI 基本相对路径
- angular - 如何在不调用订阅方法的情况下重写 rxjs 代码?
- javascript - 在 useEffect 函数中插入“调度”函数作为依赖项是否安全?
- javascript - 如何使用 CURL 命令从 dynamoDB 中删除项目?
- c++ - 用成对向量提升几何区域?
- prolog - 在 prolog 中为多集编写联合操作
- sql - 从 Azure Blob 到 Snowflake 的增量数据存储过程加载