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" \
148148```
149149
150150### 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:
152152
153153``` php
154154use Illuminate\Http\Request;
155+ use Workflow\Auth\WebhookAuthenticator;
155156
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+ }
158169}
159170```
160171
You can’t perform that action at this time.
0 commit comments