Skip to content

Commit a52424c

Browse files
committed
feat: fix up samples
1 parent edddcb6 commit a52424c

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

src/content/docs/workflows/example-workflows/existing-password-provided-workflow.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,25 @@ The main argument provided to your code is the Kinde workflow `event` object whi
3333

3434
```json
3535
{
36-
"request": {},
36+
"request": {
37+
"ip": "192.168.0.1",
38+
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0"
39+
},
3740
"context": {
3841
"domains": {
3942
"kindeDomain": "https://example.kinde.com" // Your Kinde domain
4043
},
4144
"auth": {
42-
"provided email": "[email protected]", // the email provided by the user
45+
"providedEmail": "[email protected]", // the email provided by the user
4346
"password": "someSecurePassword", // the raw password
4447
"hashedPassword": "someHash", // the hashed password,
4548
"hasUserRecordInKinde": false // whether the user exists already in Kinde
4649
},
4750
"user": {
4851
"id": "kp_1234566" // only provided in password reset flows as otherwise new user
52+
},
53+
"workflow": {
54+
"trigger": "user:existing_password_provided"
4955
}
5056
}
5157
}

src/content/docs/workflows/example-workflows/m2m-token-generation-workflow.mdx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,24 @@ The main argument provided to your code is the Kinde workflow `event` object whi
4040

4141
```json
4242
{
43-
"request": {
44-
"auth": {
45-
"audience": ["<EXAMPLE_API>"]
46-
},
47-
"ip": "192.168.0.1"
48-
},
49-
"context": {
50-
"domains": {
51-
"kindeDomain": "https://example.kinde.com" // Your Kinde domain
52-
},
53-
"application": {
54-
"clientId": "299627bd8bfa493f8b17e6aec8ebfb86" // the M2M application ID
55-
},
56-
"workflow": {
57-
"trigger": "m2m:token_generation"
58-
}
43+
"request": {
44+
"auth": {
45+
"audience": ["<EXAMPLE_API>"],
46+
"scope": ["read:users"]
47+
},
48+
"ip": "192.168.0.1"
49+
},
50+
"context": {
51+
"domains": {
52+
"kindeDomain": "https://example.kinde.com" // Your Kinde domain
53+
},
54+
"application": {
55+
"clientId": "299627bd8bfa493f8b17e6aec8ebfb86" // the M2M application ID
56+
},
57+
"workflow": {
58+
"trigger": "m2m:token_generation"
59+
}
60+
}
5961
}
6062
```
6163

src/content/docs/workflows/example-workflows/new-password-provided-workflow.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ The main argument provided to your code is the Kinde workflow `event` object whi
4545

4646
```json
4747
{
48-
"request": {},
48+
"request": {
49+
"ip": "192.168.0.1",
50+
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0"
51+
},
4952
"context": {
5053
"domains": {
5154
"kindeDomain": "https://example.kinde.com" // Your Kinde domain
@@ -58,6 +61,9 @@ The main argument provided to your code is the Kinde workflow `event` object whi
5861
"user": {
5962
"id": "kp_1234566", // only provided in password reset flows as otherwise new user
6063
"email": "[email protected]" // the email provided
64+
},
65+
"workflow": {
66+
"trigger": "user:new_password_provided"
6167
}
6268
}
6369
}

src/content/docs/workflows/example-workflows/pre-mfa-workflow.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ The main argument provided to your code is the Kinde workflow `event` object whi
4444

4545
```json
4646
{
47-
"request": {},
47+
"request": {
48+
"ip": "192.168.0.1",
49+
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0"
50+
},
4851
"context": {
4952
"auth": {
5053
"connectionId": "conn_01945d3ccf4926118bfdeb6e1158edb5" // connection ID the user auth'd with

src/content/docs/workflows/example-workflows/user-token-generation.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,22 @@ The main argument provided to your code is the Kinde workflow `event` object whi
5959
"kindeDomain": "<https://example.kinde.com>" // Your Kinde domain
6060
},
6161
"auth": {
62-
"reason": "authorization_request" | "refresh_token_request",
63-
"isExistingSession": false, // if user was preauthenticated,
64-
"connectionId": "conn_12345" // the ID of the auth connection method used
62+
"origin": "authorization_request" | "refresh_token_request",
63+
"isExistingSession": false, // if user was preauthenticated,
64+
"connectionId": "conn_12345" // the ID of the auth connection method used
6565
},
6666
"application": {
67-
"clientId": "299627bd8bfa493f8b17e6aec8ebfb86" // the M2M application ID
67+
"clientId": "299627bd8bfa493f8b17e6aec8ebfb86" // the M2M application ID
6868
},
6969
"user": {
70-
"id": "kp_1234567890", // the ID of the user
71-
"identityId": "identity_123456789" // the ID of the identity the user authenticated with
70+
"id": "kp_1234567890", // the ID of the user
71+
"identityId": "identity_123456789" // the ID of the identity the user authenticated with
7272
},
7373
"organization": {
7474
"code": "org_123456789" // the org code the user authorized against
75+
},
76+
"workflow": {
77+
"trigger": "user:tokens_generation"
7578
}
7679
}
7780
}

0 commit comments

Comments
 (0)