Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metada_admin not available in post registration hook payload #3894

Open
3 of 5 tasks
trautonen opened this issue Apr 24, 2024 · 0 comments
Open
3 of 5 tasks

metada_admin not available in post registration hook payload #3894

trautonen opened this issue Apr 24, 2024 · 0 comments
Labels
bug Something is not working.

Comments

@trautonen
Copy link

trautonen commented Apr 24, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

In 1.1.0 (#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 trautonen added the bug Something is not working. label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant