{"action":"created","issue":{"url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/4","repository_url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate","labels_url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/4/comments","events_url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/4/events","html_url":"https://github.com/cosmic-byte/flask-restplus-boilerplate/issues/4","id":390124059,"node_id":"MDU6SXNzdWUzOTAxMjQwNTk=","number":4,"title":"Question: token_require, access user object","user":{"login":"spoetnik","id":2156270,"node_id":"MDQ6VXNlcjIxNTYyNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/2156270?v=4","gravatar_id":"","url":"https://api.github.com/users/spoetnik","html_url":"https://github.com/spoetnik","followers_url":"https://api.github.com/users/spoetnik/followers","following_url":"https://api.github.com/users/spoetnik/following{/other_user}","gists_url":"https://api.github.com/users/spoetnik/gists{/gist_id}","starred_url":"https://api.github.com/users/spoetnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoetnik/subscriptions","organizations_url":"https://api.github.com/users/spoetnik/orgs","repos_url":"https://api.github.com/users/spoetnik/repos","events_url":"https://api.github.com/users/spoetnik/events{/privacy}","received_events_url":"https://api.github.com/users/spoetnik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-12T08:56:21Z","updated_at":"2018-12-17T10:09:29Z","closed_at":null,"author_association":"NONE","body":"Say, I have an endpoint with the '`token_required`' decorator. How can I access the current logged in user account in a service class?\r\n\r\nTo give an example, I have an endpoint 'my-blogposts' that shows only blogpost from the current author, so I want to filter something like: `return Posts.query.filter_by(author=g.user.get('id')).all()` or something."},"comment":{"url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/comments/447790241","html_url":"https://github.com/cosmic-byte/flask-restplus-boilerplate/issues/4#issuecomment-447790241","issue_url":"https://api.github.com/repos/cosmic-byte/flask-restplus-boilerplate/issues/4","id":447790241,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Nzc5MDI0MQ==","user":{"login":"cosmic-byte","id":30266850,"node_id":"MDQ6VXNlcjMwMjY2ODUw","avatar_url":"https://avatars0.githubusercontent.com/u/30266850?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmic-byte","html_url":"https://github.com/cosmic-byte","followers_url":"https://api.github.com/users/cosmic-byte/followers","following_url":"https://api.github.com/users/cosmic-byte/following{/other_user}","gists_url":"https://api.github.com/users/cosmic-byte/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmic-byte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmic-byte/subscriptions","organizations_url":"https://api.github.com/users/cosmic-byte/orgs","repos_url":"https://api.github.com/users/cosmic-byte/repos","events_url":"https://api.github.com/users/cosmic-byte/events{/privacy}","received_events_url":"https://api.github.com/users/cosmic-byte/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T10:09:29Z","updated_at":"2018-12-17T10:09:29Z","author_association":"OWNER","body":"Hi, @spoetnik sorry for the late response. You can access the logged in user using the `get_logged_in_user` method in the `Auth` class \r\n\r\n```python\r\nfrom flask import request\r\n\r\nuser, status = Auth.get_logged_in_user(request)\r\n```"}}
{"actor":{"display_login":"cosmic-byte"}}