def pusher_auth(request): """ This function is the authentication end point for the pusher stream """ if not request.user.is_authenticated(): return JsonResponse({'error': 'Not Authenticated for this stream'}, status=404) if not request.POST.get('channel_name') or not request.POST.get('socket_id'): return JsonResponse({'error': 'Incorrect parameters for authentication'}, status=404) auth = AUCTIONEER.authenticate( request.POST.get('channel_name'), request.POST.get('socket_id') ) return JsonResponse(auth)
def pusher_auth(request): """ This function is the authentication end point for the pusher stream """ if not request.user.is_authenticated(): return JsonResponse({'error': 'Not Authenticated for this stream'}, status=404) if not request.POST.get('channel_name') or not request.POST.get( 'socket_id'): return JsonResponse( {'error': 'Incorrect parameters for authentication'}, status=404) auth = AUCTIONEER.authenticate(request.POST.get('channel_name'), request.POST.get('socket_id')) return JsonResponse(auth)