File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -22,16 +22,14 @@ def event():
2222 event_data .get ("challenge" ), 200 , {"content_type" : "application/json" }
2323 )
2424
25+ # Verify the request token
26+ request_token = event_data .get ("token" )
27+ if self .verification_token != request_token :
28+ emitter .emit ('error' , 'invalid verification token' )
29+ return make_response ("Request contains invalid Slack verification token" , 403 )
30+
2531 # Parse the Event payload and emit the event to the event listener
2632 if "event" in event_data :
27- # Verify the request token
28- request_token = event_data .get ("token" )
29- if self .verification_token != request_token :
30- emitter .emit ('error' , 'invalid verification token' )
31- message = "Request contains invalid Slack verification token: %s\n " \
32- "Slack adapter has: %s" % (request_token , self .verification_token )
33- return make_response (message , 403 )
34-
3533 event_type = event_data ["event" ]["type" ]
3634 emitter .emit (event_type , event_data )
3735 return make_response ("" , 200 )
You can’t perform that action at this time.
0 commit comments