hi guys, in kratos, during registration flow, my t...
# ory-selfhosting
m
hi guys, in kratos, during registration flow, my team sends the completeRegistrationFlow API from FE to kratos, and we want to use after registration flow hook to validate the password in BE side. I’m trying to get the password information from kratos context, but it seems like the password is not there, is there any way I can get the password to use in the afterhook, here is the information that we can get from kratos after hook
Copy code
Headers: map[Accept-Encoding:[gzip] Content-Length:[3852] Content-Type:[application/json] User-Agent:[Go-http-client/1.1]]
Body: &{src:0xc0000a0270 hdr:<nil> r:<nil> closing:false doEarlyClose:true mu:{state:0 sema:0} sawEOF:true closed:false earlyClose:false onHitEOF:0x12327c0}
{
	"ctx": {
		"flow": {
			"expires_at": "2023-09-02T05:37:55.500943Z",
			"id": "77799ff6-549a-43de-8577-7f36dcf0c4e4",
			"issued_at": "2023-08-30T05:37:55.500943Z",
			"oauth2_login_challenge": null,
			"request_url": "<http://127.0.0.1:4433/self-service/registration/api>",
			"transient_payload": {},
			"type": "api",
			"ui": {
				"action": "<http://127.0.0.1:4433/self-service/registration?flow=77799ff6-549a-43de-8577-7f36dcf0c4e4>",
				"method": "POST",
				"nodes": [
					{
						"attributes": {
							"disabled": false,
							"name": "csrf_token",
							"node_type": "input",
							"required": true,
							"type": "hidden",
							"value": ""
						},
						"group": "default",
						"messages": [],
						"meta": {},
						"type": "input"
					},
					{
						"attributes": {
							"disabled": false,
							"name": "traits.userID",
							"node_type": "input",
							"type": "text"
						},
						"group": "password",
						"messages": [],
						"meta": {},
						"type": "input"
					},
					{
						"attributes": {
							"autocomplete": "new-password",
							"disabled": false,
							"name": "password",
							"node_type": "input",
							"required": true,
							"type": "password"
						},
						"group": "password",
						"messages": [],
						"meta": {
							"label": {
								"id": 1070001,
								"text": "Password",
								"type": "info"
							}
						},
						"type": "input"
					},
					{
						"attributes": {
							"disabled": false,
							"name": "method",
							"node_type": "input",
							"type": "submit",
							"value": "password"
						},
						"group": "password",
						"messages": [],
						"meta": {
							"label": {
								"context": {},
								"id": 1040001,
								"text": "Sign up",
								"type": "info"
							}
						},
						"type": "input"
					}
				]
			}
		},
		"identity": {
			"created_at": "2023-08-30T05:37:55.619476Z",
			"id": "00d5ab81-0e22-48a6-ac3c-8be865e97358",
			"metadata_public": null,
			"schema_id": "default",
			"schema_url": "<http://127.0.0.1:4433/schemas/ZGVmYXVsdA>",
			"state": "active",
			"state_changed_at": "2023-08-30T05:37:55.618519877Z",
			"traits": {
				"userID": "7802d257-a34b-4e87-83e5-4c1b90cf7f15"
			},
			"updated_at": "2023-08-30T05:37:55.619476Z"
		},
		"request_cookies": {},
		"request_headers": {
			"Accept": [
				"application/json"
			],
			"Accept-Encoding": [
				"gzip"
			],
			"Content-Length": [
				"108"
			],
			"Content-Type": [
				"application/json"
			],
			"User-Agent": [
				"OpenAPI-Generator/1.0.0/go"
			]
		},
		"request_method": "POST",
		"request_url": "<http://127.0.0.1:4433/self-service/registration?flow=77799ff6-549a-43de-8577-7f36dcf0c4e4>"
	}
}
Good morning @magnificent-energy-493 @tall-angle-41306, please support me with this topic when you have time 😄