def pusher_authentication(): channel_name = request.form.get('channel_name') socket_id = request.form.get('socket_id') auth = pusher.authenticate(channel=channel_name, socket_id=socket_id) return jsonify(auth)
def pusher_authentication(request): auth = pusher.authenticate(channel=request.POST['channel_name'], socket_id=request.POST['socket_id'], custom_data={ u'user_id': name, u'user_info': { u'role': u'player' } }) return JsonResponse(auth)
def pusher_authentication(): channel_name = request.form.get('channel_name') socket_id = request.form.get('socket_id') username = get_jwt_identity() user_data = User.query.filter_by(username=username).first() auth = pusher.authenticate(channel=channel_name, socket_id=socket_id, custom_data={ "user_id": user_data.id, "user_info": { "username": user_data.username } }) return jsonify(auth)
def post(self, request): auth = pusher.authenticate(channel=request.form['channel_name'], socket_id=request.form['socket_id']) return json.dumps(auth)