flat-rose-25983
09/08/2022, 12:54 PMbland-eye-99092
09/08/2022, 1:02 PMflat-rose-25983
09/08/2022, 1:40 PMflat-rose-25983
09/08/2022, 1:41 PMHere is my request
fetch(
// `<https://kratos-admin.dev.ukama.com/admin/identities/${response.data.id}>`,
`<http://localhost:4433/.ory/kratos/public/admin/identities/${response.data.id}>`,
{
credentials: "include",
method: "PUT",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
schema_id: response.data.id,
state: "active",
traits: {
firstVisit: true,
},
}),
}
)
.then(res => res.json())
.then(res => console.log("DATA", res));
bland-eye-99092
09/08/2022, 1:56 PMbland-eye-99092
09/08/2022, 2:03 PMflat-rose-25983
09/08/2022, 2:07 PMbland-eye-99092
09/08/2022, 2:08 PMflat-rose-25983
09/08/2022, 2:12 PMflat-rose-25983
09/08/2022, 2:15 PMisFirstVisit
which I need to updated when a user login check if it is firstimebland-eye-99092
09/08/2022, 2:19 PMflat-rose-25983
09/08/2022, 2:20 PMbland-eye-99092
09/08/2022, 2:23 PMflat-rose-25983
09/08/2022, 2:25 PMlogin:
ui_url: /auth/login
lifespan: 10m
bland-eye-99092
09/08/2022, 2:28 PMafter login
hook is relevant. 🙂flat-rose-25983
09/08/2022, 2:31 PMbland-eye-99092
09/08/2022, 3:28 PMselfservice:
flows:
login:
after:
hooks:
- hook: web_hook _# To use webhooks, you must set 'hook' to 'web_hook'_
config:
url: <https://test.hook.site.sh/before_login_hook>
# ****** THIS WOULD BE YOUR URL *******
method: POST _# HTTP method used to send request to the webhook URL._
body: file:///path/of/my/jsonnet/file _# HERE YOU NEED TO DEFINE A BODY DEFINITION_
# Ignored when using an HTTP method that doesn't allow sending body. OPTIONAL
can_interrupt: true _# You Probably want to set this to false_
auth:
type: _# Can be one of 'basic_auth' or 'api_key'_
config: _# Additional auth config for the hook. Read next section for details._
flat-rose-25983
09/09/2022, 2:01 PM