This commit is contained in:
parent
642c4eeb9d
commit
bf7bc03e50
6
main.py
6
main.py
|
@ -66,9 +66,9 @@ class WebhookEndpoint(HTTPEndpoint):
|
|||
auth = request.headers.get("Authorization")
|
||||
if auth:
|
||||
if auth == os.environ.get("WEBHOOK_SECRET"):
|
||||
user_id = data["user"]["id"]
|
||||
slug = (data["user"]["preferred_username"] or data["user"]["email"]).split("@")[0].lowercase()
|
||||
slug = re.sub("[^0-9a-zA-Z]+", "-", slug or "")
|
||||
user_id: str = data["user"]["id"]
|
||||
slug: str = data["user"]["email"].split("@")[0]
|
||||
slug: str = re.sub("[^0-9a-z]+", "-", slug.lower())
|
||||
await create_author(user_id, slug)
|
||||
return JSONResponse({"status": "success"})
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in New Issue
Block a user