首页 > 解决方案 > 如何使用 drf 和 vuejs 设置 github 身份验证?

问题描述

我按照本教程进行操作,并且能够为 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)
        })
    },

标签: vue.jsauthenticationgithubdjango-rest-framework

解决方案


推荐阅读