File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,24 @@ curl -X POST "https://example.com/webhooks/start/order-workflow" \
148
148
```
149
149
150
150
### Custom Authentication
151
- To use a custom authenticator, create a class that implements the following interface:
151
+ To use a custom authenticator, create a class that implements the ` WebhookAuthenticator ` interface:
152
152
153
153
``` php
154
154
use Illuminate\Http\Request;
155
+ use Workflow\Auth\WebhookAuthenticator;
155
156
156
- interface WebhookAuthenticator {
157
- public function validate(Request $request): Request;
157
+ class CustomAuthenticator implements WebhookAuthenticator
158
+ {
159
+ public function validate(Request $request): Request
160
+ {
161
+ $allow = true;
162
+
163
+ if ($allow) {
164
+ return $request;
165
+ } else {
166
+ abort(401, 'Unauthorized');
167
+ }
168
+ }
158
169
}
159
170
```
160
171
You can’t perform that action at this time.
0 commit comments