microscopic-article-61270
07/14/2025, 5:47 AM{
"id": "1e4ec88b-0ec5-4e15-a9dd-348b8a638866",
// Snip for brevity
"identity": {
"id": "bf29640c-7a44-4421-940c-e10f041e05bd",
"schema_id": "default",
"schema_url": "<https://accounts.testing.local/auth-local/schemas/ZGVmYXVsdA>",
"state": "active",
"state_changed_at": "2025-05-23T06:46:43.07378Z",
"traits": {
"name": {
"last": "McKee",
"first": "AJ"
},
"email": "aj.mckee@testing.local"
},
"metadata_public": {
"foo": "bar" // This is in the login response
}
},
// Snip for brevity
}
❌ After login: sessions/whoami, the response doesn't include the metadata changes that are applied during the login.
My webhook config:
after:
password:
hooks:
- hook: web_hook
config:
url: <http://host.docker.internal:8080/api/v1/webhook>
method: POST
can_interrupt: true
response:
parse: true
ignore: false
Webhook response:
{
"identity": {
"metadata_public": {
"foo": "bar"
}
}
}
Questions:
1. Is this the expected behavior for login post-hooks?
2. Should login webhooks be able to persist metadata_public changes to the database?
3. If not, what's the recommended approach for dynamic metadata that needs to be available in sessions/whoami?
Currently, it seems like the webhook only modifies the session identity in-memory during the login flow, but sessions/whoami fetches fresh identity data from the database.