Private
Public Access
1
0

adding webhook processing for strava - does not do anything useful yet

This commit is contained in:
Sander Roosendaal
2020-07-12 10:45:40 +02:00
parent 5e023a0e07
commit c4c1a02794
3 changed files with 35 additions and 0 deletions

View File

@@ -1008,6 +1008,19 @@ def workout_stravaimport_view(request,message="",userid=0):
return HttpResponse(res)
# for Strava webhook request validation
def strava_webhook_view(request):
if request.method == 'GET':
challenge = request.GET.get('hub.challenge')
verificationtoken = request.GET.get('hub.verify_token')
if verificationtoken != stravastuff.webhookverification:
return HttpResponse(status=403)
data = {"hub.challenge":challenge}
return JSONResponse(data)
# POST - does nothing so far
return HttpResponse(status=200)
# For push notifications from Garmin
@csrf_exempt
def garmin_summaries_view(request):