Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Created June 7, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IuryAlves/5b0d561deae863801bbdda9b4743f57e to your computer and use it in GitHub Desktop.
Save IuryAlves/5b0d561deae863801bbdda9b4743f57e to your computer and use it in GitHub Desktop.
from flask.ext.login import current_user
@api.resource('/user/logged')
class Logged(Resource):
def get(self):
try:
return {"logged": current_user.to_dict()}
except AttributeError:
return {'logged': None}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment