limited-photographer-61008
07/20/2023, 3:01 PMsteep-lamp-91158
limited-photographer-61008
07/24/2023, 2:40 PMsteep-lamp-91158
limited-photographer-61008
07/24/2023, 2:59 PMlimited-photographer-61008
07/24/2023, 3:02 PMsteep-lamp-91158
limited-photographer-61008
07/24/2023, 3:10 PM"recovery": {
"after": {
"hooks": [
{
"config": {
"auth": {
"config": {
"in": "header",
"name": "Authorization",
"value": "Bearer REDACTED"
},
"type": "api_key"
},
"body": "<https://storage.googleapis.com/bac-gcs-production/51c1912d59454d98f7d0ea2365809b52ef7d6f09f6f97ccf9363da95b7aa4a8ce396b349572762843dd43f325aa4ccb4e3e7ad3fa2ebc7ddf248cad84518b460.jsonnet>",
"can_interrupt": false,
"method": "POST",
"response": {
"ignore": false,
"parse": true
},
"url": "<https://REDACTED/v1.0/webhooks/ory/recovery/after>"
},
"hook": "web_hook"
}
]
},
"before": {
"hooks": []
},
"enabled": true,
"lifespan": "30m0s",
"notify_unknown_recipients": true,
"ui_url": "/ui/recovery",
"use": "code"
},
steep-lamp-91158
steep-lamp-91158
steep-lamp-91158
When using anregistration hook, you can define the specific point in the flow where this webhook is called:after
• When the webhook parses the response, the logic is called before the system creates a new identity.
• When the webhook does not parse the response, the logic is called after the system creates a new identity.I'll open an issue for that case, but currently it is not really possible to achieve what you are trying.
steep-lamp-91158
limited-photographer-61008
07/25/2023, 11:29 AMsteep-lamp-91158
selfservice/flows/recovery
It should be a fairly manageable change, you can compare the code to registration as it works theresteep-lamp-91158
limited-photographer-61008
07/25/2023, 11:31 AMlimited-photographer-61008
07/25/2023, 2:21 PMPostLoginHook
fails, the session (sess
) gets destroyed/cancelled: https://github.com/ory/kratos/blob/master/selfservice/flow/login/handler.go#L781
Seems we would need to do the same thing here, https://github.com/ory/kratos/blob/master/selfservice/strategy/code/strategy_recovery.go#L396, instead of retrying the recovery flow.steep-lamp-91158
limited-photographer-61008
07/25/2023, 2:24 PMlimited-photographer-61008
07/25/2023, 2:25 PMNewInactiveSession
vs NewActiveSession
for recovery.steep-lamp-91158
steep-lamp-91158
limited-photographer-61008
07/25/2023, 2:34 PMPostRecoveryHook
call above this line? https://github.com/ory/kratos/blob/master/selfservice/strategy/code/strategy_recovery.go#L377steep-lamp-91158
steep-lamp-91158
steep-lamp-91158
limited-photographer-61008
07/25/2023, 2:38 PMPostRegistrationPrePersistHook
and PostRegistrationPostPersistHook
. But login only has one post hook.steep-lamp-91158
parse: true
it automatically interrupts on errors? otherwise it runs async and cannot interrupt?steep-lamp-91158
steep-lamp-91158
steep-lamp-91158
limited-photographer-61008
07/25/2023, 2:42 PMsteep-lamp-91158
limited-photographer-61008
07/25/2023, 2:46 PMsteep-lamp-91158
go test -tags sqlite,json1 -short -failfast ./...
should be enoughlimited-photographer-61008
08/18/2023, 12:06 PMsteep-lamp-91158
limited-photographer-61008
08/18/2023, 12:55 PM