Can you give me some feedback for the proposed con...
# talk-kratos
a
Can you give me some feedback for the proposed config and if you still consider a config to support pre and post-persist hooks?
m
Hello Steffen, I think the person who is most qualified to make a decision here is @high-optician-2097. Please be patient, there are always dozens of other issues and reviews waiting for Ory maintainers 🙏 Feel free to remind us again if there is no response in a reasonable timeframe
h
Where can I find the proposal?
a
In the Github issue https://github.com/ory/kratos/issues/2767 I would like to add a config flag that defines when a registration hook is run and allow a hook to run pre and post persist. My use case for running a hook twice (or two separate hooks) is that we would like to verify the registration pre persist (e.g. for invitation codes) and update the identity meta data after registration, which is only possible post persist. The config could look like this:
Copy code
flows:
          registration:
            after:
              password:
                hooks:
                  - hook: web_hook
                    config:
                      url: ...
                      pre_persist: true (defaults to can_interrupt 
                      post_persist: true  (defaults to !can_interrupt)
The defaults are for compatibility with the current behaviour. since the hook is run pre persist if can_interrupt is true and post persist otherwise (see https://github.com/ory/kratos/pull/2888/files).
h
Can’t you solve this using
can_interrupt
already today? I’m not sure I understand the need for adding two new config options
Copy code
flows:
          registration:
            after:
              password:
                hooks:
                  - hook: web_hook
                    config:
                      can_interrupt: true
                      # ...
                  - hook: web_hook
                    config:
                      can_interrupt: false
                      # ...
Ah, I’ll answer in the issue
a
Thanks you, I've replied in the issue too, since it's more accessible.