@@ -32,11 +32,16 @@ import (
32
32
"github.com/ory/x/otelx"
33
33
)
34
34
35
- var _ registration.PostHookPostPersistExecutor = new (WebHook )
36
- var _ registration.PostHookPrePersistExecutor = new (WebHook )
37
- var _ verification.PostHookExecutor = new (WebHook )
38
- var _ recovery.PostHookExecutor = new (WebHook )
39
- var _ settings.PostHookPostPersistExecutor = new (WebHook )
35
+ var (
36
+ _ registration.PostHookPostPersistExecutor = new (WebHook )
37
+ _ registration.PostHookPrePersistExecutor = new (WebHook )
38
+
39
+ _ verification.PostHookExecutor = new (WebHook )
40
+
41
+ _ recovery.PostHookExecutor = new (WebHook )
42
+
43
+ _ settings.PostHookPostPersistExecutor = new (WebHook )
44
+ )
40
45
41
46
type (
42
47
webHookDependencies interface {
@@ -155,6 +160,10 @@ func (e *WebHook) ExecuteRegistrationPreHook(_ http.ResponseWriter, req *http.Re
155
160
156
161
func (e * WebHook ) ExecutePostRegistrationPrePersistHook (_ http.ResponseWriter , req * http.Request , flow * registration.Flow , id * identity.Identity ) error {
157
162
ctx , _ := e .deps .Tracer (req .Context ()).Tracer ().Start (req .Context (), "selfservice.hook.ExecutePostRegistrationPrePersistHook" )
163
+ if ! gjson .GetBytes (e .conf , "can_interrupt" ).Bool () {
164
+ return nil
165
+ }
166
+
158
167
return e .execute (ctx , & templateContext {
159
168
Flow : flow ,
160
169
RequestHeaders : req .Header ,
@@ -166,6 +175,10 @@ func (e *WebHook) ExecutePostRegistrationPrePersistHook(_ http.ResponseWriter, r
166
175
167
176
func (e * WebHook ) ExecutePostRegistrationPostPersistHook (_ http.ResponseWriter , req * http.Request , flow * registration.Flow , session * session.Session ) error {
168
177
ctx , _ := e .deps .Tracer (req .Context ()).Tracer ().Start (req .Context (), "selfservice.hook.ExecutePostRegistrationPostPersistHook" )
178
+ if gjson .GetBytes (e .conf , "can_interrupt" ).Bool () {
179
+ return nil
180
+ }
181
+
169
182
return e .execute (ctx , & templateContext {
170
183
Flow : flow ,
171
184
RequestHeaders : req .Header ,
@@ -187,6 +200,10 @@ func (e *WebHook) ExecuteSettingsPreHook(_ http.ResponseWriter, req *http.Reques
187
200
188
201
func (e * WebHook ) ExecuteSettingsPostPersistHook (_ http.ResponseWriter , req * http.Request , flow * settings.Flow , id * identity.Identity ) error {
189
202
ctx , _ := e .deps .Tracer (req .Context ()).Tracer ().Start (req .Context (), "selfservice.hook.ExecuteSettingsPostPersistHook" )
203
+ if gjson .GetBytes (e .conf , "can_interrupt" ).Bool () {
204
+ return nil
205
+ }
206
+
190
207
return e .execute (ctx , & templateContext {
191
208
Flow : flow ,
192
209
RequestHeaders : req .Header ,
0 commit comments