Skip to content

Commit 5dbc93e

Browse files
awolfdenAdam Wolfman
andauthored
Update webhooks route for latest SDK release (#48)
Co-authored-by: Adam Wolfman <[email protected]>
1 parent ed0f1f9 commit 5dbc93e

File tree

1 file changed

+1
-4
lines changed
  • python-django-directory-sync-example/directory_sync

1 file changed

+1
-4
lines changed

python-django-directory-sync-example/directory_sync/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,11 @@ def get_directory_groups(request):
6767
@csrf_exempt
6868
def webhooks(request):
6969
if request.body:
70-
dict_payload = json.loads(request.body)
71-
payload = json.dumps(dict_payload)
70+
payload = request.body
7271
sig_header = request.headers.get("WorkOS-Signature")
73-
7472
response = workos.client.webhooks.verify_event(
7573
payload=payload, sig_header=sig_header, secret=os.getenv("WEBHOOKS_SECRET")
7674
)
77-
7875
message = json.dumps(response)
7976
sio.emit("webhook_received", message)
8077

0 commit comments

Comments
 (0)