Implement webhook for user signup notifications

Added webhook notification for user signup.
This commit is contained in:
Classic298 2025-12-11 20:02:53 +01:00 committed by GitHub
parent 492c8bac09
commit 668a21198d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -867,6 +867,18 @@ async def add_user(
user.id,
)
if request.app.state.config.WEBHOOK_URL:
await post_webhook(
request.app.state.WEBUI_NAME,
request.app.state.config.WEBHOOK_URL,
WEBHOOK_MESSAGES.USER_SIGNUP(user.name),
{
"action": "signup",
"message": WEBHOOK_MESSAGES.USER_SIGNUP(user.name),
"user": user.model_dump_json(exclude_none=True),
},
)
token = create_token(data={"id": user.id})
return {
"token": token,