def authorized(): if request.user: return send_data({'username': request.user.username}) return send_error('not authorized')