Skip to content

Commit 1b57fdf

Browse files
jonas-jonasory-bot
authored andcommitted
feat: add session in settings after hook
GitOrigin-RevId: 754c057a2d2d5b92a417b429caea524a5d54b184
1 parent 4a07685 commit 1b57fdf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

selfservice/hook/web_hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (e *WebHook) ExecuteSettingsPreHook(_ http.ResponseWriter, req *http.Reques
261261
})
262262
}
263263

264-
func (e *WebHook) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, req *http.Request, flow *settings.Flow, id *identity.Identity, _ *session.Session) error {
264+
func (e *WebHook) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, req *http.Request, flow *settings.Flow, id *identity.Identity, s *session.Session) error {
265265
if e.conf.CanInterrupt || e.conf.Response.Parse {
266266
return nil
267267
}
@@ -273,6 +273,7 @@ func (e *WebHook) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, req *htt
273273
RequestURL: x.RequestURL(req).String(),
274274
RequestCookies: cookies(req),
275275
Identity: id,
276+
Session: s,
276277
})
277278
})
278279
}

selfservice/hook/web_hook_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func TestWebHooks(t *testing.T) {
290290
return wh.ExecuteSettingsPostPersistHook(nil, req, f.(*settings.Flow), s.Identity, s)
291291
},
292292
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
293-
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
293+
return bodyWithFlowAndIdentityAndSessionAndTransientPayload(req, f, s, transientPayload)
294294
},
295295
},
296296
} {

0 commit comments

Comments
 (0)