webhooks: add "user created" webhook
Webhooks send a POST to an admin-supplied URL when something happens, with relevant information sent in JSON. One has been added for creating users in Settings > Webhooks > User Created. Lazily, the portion of GetUsers which generates a respUser has been factored out, and is called to send the JSON payload. A stripped-down common.Req method has been added, which is used by the barebones WebhookSender struct.
This commit is contained in:
@@ -666,7 +666,7 @@ func (app *appContext) NewUserFromConfirmationKey(invite Invite, key string, lan
|
||||
profile = &p
|
||||
}
|
||||
|
||||
nu := app.NewUserPostVerification(NewUserParams{
|
||||
nu /*wg*/, _ := app.NewUserPostVerification(NewUserParams{
|
||||
Req: req,
|
||||
SourceType: sourceType,
|
||||
Source: source,
|
||||
@@ -707,6 +707,9 @@ func (app *appContext) NewUserFromConfirmationKey(invite Invite, key string, lan
|
||||
delete(invKeys, key)
|
||||
app.ConfirmationKeys[invite.Code] = invKeys
|
||||
app.confirmationKeysLock.Unlock()
|
||||
|
||||
// These don't need to complete anytime soon
|
||||
// wg.Wait()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user