kratos
kratos copied to clipboard
metada_admin not available in post registration hook payload
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
In 1.1.0 (https://github.com/ory/kratos/issues/3192) modifying metadata_admin on webhooks was fixed, but when receiving the payload in after hooks the metadata_admin does not exist anymore.
Reproducing the bug
Create after registration hook such as:
registration:
ui_url: http://127.0.0.1:3000/registration
lifespan: 1h
after:
password:
hooks:
- hook: web_hook
config:
url: http://127.0.0.1:3000/webhooks/after-registration
method: POST
body: file:///etc/config/kratos/after_registration_hook.jsonnet
response:
ignore: false
parse: false
with jssonet after_registration_hook.jsonnet
function(ctx) {
userId: std.get(ctx.identity, 'id'),
ctx: ctx
}
Inspect the ctx
payload and see that it does not contain metadata_admin
field in identity
at all even if you set in in before hook and can inspect directly from database that it is there.
Relevant log output
No response
Relevant configuration
registration:
ui_url: http://127.0.0.1:3000/registration
lifespan: 1h
after:
password:
hooks:
- hook: web_hook
config:
url: http://127.0.0.1:3000/webhooks/after-registration
method: POST
body: file:///etc/config/kratos/after_registration_hook.jsonnet
response:
ignore: false
parse: false
Version
1.1.0
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
No response