pallets-eco/flask-social

get_api method hard coded to current_user

Opened this issue · 0 comments

in core.py
47 def get_connection(self):
48 return _social.datastore.find_connection(provider_id=self.id,
49 user_id=current_user.id) <<<------ HERE
50
51 def get_api(self):
52 module = import_module(self.module)
53 connection = self.get_connection() <<--- Get_connection assumes current_user.
54 if connection is None:
55 return None
56 return module.get_api(connection=connection,
57 consumer_key=self.consumer_key,
58 consumer_secret=self.consumer_secret)

User id is hard coded to the current_user. Requesting parameters to pass user. This may be required when social activities are done in a different context than a normal request.

Have a commit coming shortly.