def oauth_from_token(meta):
"""
Recreate a oauth2 object from a token
args:
token (dict): a oauth2 token object
token_updater (func): a function that is triggered upon a token update
returns:
OAuth2Session: an auth2 session
"""
def inner(new_token):
meta.update_token(new_token)
return OAuth2Session(token=meta.token, auto_refresh_url=meta.token_endpoint, scope=scope, token_updater=inner,
client_id=client_id)
评论列表
文章目录