gocodebox / gocodebox/lifterlms

Webhook fails if the user who created the webhook is deleted or does not have access

Open
#2,932 1 comment 0 reactions 1 assignee Assigned to @brianhogg View on GitHub
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

### Reproduction Steps

1. As an admin user, create a webhook for "Enrollment created" under _LifterLMS > Settings_, REST API tab, Webhooks sub-tab
2. Delete the user from the WP site

### Expected Behavior

The webhook continues to function

### Actual Behavior

The webhook sends an unauthorized message as the data.

### Tech notes

This could also show "You are not allowed to view this student." instead of invalid API credentials if the user that created the webhook doesn't have access to the student. I'm not sure the exact steps to replicate this scenario since if I switch the user to a Student role, I get `llms_rest_forbidden_request` instead.

### Error Messages / Logs

```
{
"code": "llms_rest_unauthorized_request",
"message": "The API credentials were invalid.",
"data": {
"status": 401
}
}
```

HS-258744

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.