token = authorization[u"oauth_token"]
request.access_token = AccessToken.query.filter_by(token=token).first()
if request.access_token is not None and request.user is None:
- user_id = request.access_token.user
+ user_id = request.access_token.actor
request.user = LocalUser.query.filter_by(id=user_id).first()
return controller(request, *args, **kwargs)
client_id = self.POST[u"oauth_consumer_key"]
request_token = RequestToken(
- token=token["oauth_token"],
- secret=token["oauth_token_secret"],
- )
+ token=token["oauth_token"],
+ secret=token["oauth_token_secret"],
+ )
request_token.client = client_id
if u"oauth_callback" in self.POST:
request_token.callback = self.POST[u"oauth_callback"]
def save_access_token(self, token, request):
""" Saves access token in db """
access_token = AccessToken(
- token=token["oauth_token"],
- secret=token["oauth_token_secret"],
+ token=token["oauth_token"],
+ secret=token["oauth_token_secret"],
)
access_token.request_token = request.oauth_token
request_token = RequestToken.query.filter_by(token=request.oauth_token).first()
- access_token.user = request_token.user
+ access_token.actor = request_token.actor
access_token.save()
def get_realms(*args, **kwargs):
verifier = auth_endpoint.create_verifier(orequest, {})
oauth_request.verifier = verifier["oauth_verifier"]
- oauth_request.user = request.user.id
+ oauth_request.actor = request.user.id
oauth_request.save()
# find client & build context