Hi everyone Just quick question on after-verifica...
# talk-kratos
m
Hi everyone Just quick question on after-verification hook.
Copy code
verification:
      enabled: true
      use: code
      after:
        hooks:
          - hook: web_hook
            config:
              url: http://...
              method: POST
              response:
                ignore: true
              # function(ctx) { identity: ctx.identity }
              body: <base64://ZnVuY3Rpb24oY3R4KSB7IGlkZW50aXR5OiBjdHguaWRlbnRpdHkgfQ>==
              can_interrupt: false
Hook gets triggered, but it seems identity data delivered reflects state before verification was confirmed:
Copy code
"identity": {
    "verifiable_addresses": [
      {
        "created_at": "2023-04-24T09:41:38.718726Z",
        "id": "a6bb375f-7d5a-4c48-9a82-af459a29a2dc",
        "status": "sent",
        "updated_at": "2023-04-24T09:41:38.718726Z",
        "value": "test4@test.test",
        "verified": false,
        "via": "email"
      }
    ]
  }
And this is what I can see in the session data (and would expect to come in as hook payload)
Copy code
"identity": {
    "verifiable_addresses": [
      {
        "id": "a6bb375f-7d5a-4c48-9a82-af459a29a2dc",
        "value": "test4@test.test",
        "verified": true,
        "via": "email",
        "status": "completed",
        "verified_at": "2023-04-24T09:42:10.861523Z",
        "created_at": "2023-04-24T09:41:38.718726Z",
        "updated_at": "2023-04-24T09:41:38.718726Z"
      }
    ]
  }
Should I assume once hook was triggered - verification was successful regardless of status signaled? marcin
h
you mean after verification hook or after registration hook?
m
Verfication. The one after confirming e-mail address.
b
Can confirm, we seem to set the verified state after executing the hook. I guess the payload should contain
verified: true
. Could you raise an issue in ory/kratos for this @mammoth-apple-71126? Thank you.
m