kratos icon indicating copy to clipboard operation
kratos copied to clipboard

metada_admin not available in post registration hook payload

Open trautonen opened this issue 10 months ago • 0 comments

Preflight checklist

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

trautonen avatar Apr 24 '24 10:04 trautonen