Fix cookie auth to work with oauth token auth. Make sure user loading is truly deferred to save DB connections.
This commit is contained in:
parent
e759066ae0
commit
5bb4008880
6 changed files with 65 additions and 26 deletions
|
@ -111,11 +111,8 @@ class User(ApiResource):
|
|||
@nickname('getLoggedInUser')
|
||||
def get(self):
|
||||
""" Get user information for the authenticated user. """
|
||||
if get_authenticated_user() is None:
|
||||
return {'anonymous': True}
|
||||
|
||||
user = get_authenticated_user()
|
||||
if not user or user.organization:
|
||||
if user is None or user.organization:
|
||||
return {'anonymous': True}
|
||||
|
||||
return user_view(user)
|
||||
|
|
Reference in a new issue