oauth2.py 文件源码

python
阅读 48 收藏 0 点赞 0 评论 0

项目:Sanic-OAuth 作者: Sniedes722 项目源码 文件源码
def tokensetter(self, f):
        """Register a function to save the bearer token.
        The setter accepts two parameters at least, one is token,
        the other is request::
            @oauth.tokensetter
            def set_token(token, request, *args, **kwargs):
                save_token(token, request.client, request.user)
        The parameter token is a dict, that looks like::
            {
                u'access_token': u'6JwgO77PApxsFCU8Quz0pnL9s23016',
                u'token_type': u'Bearer',
                u'expires_in': 3600,
                u'scope': u'email address'
            }
        The request is an object, that contains an user object and a
        client object.
        """
        self._tokensetter = f
        return f
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号