kratos icon indicating copy to clipboard operation
kratos copied to clipboard

SDK `UpdateRegistrationFlow()` returns nil values despite successful call

Open Gromitmugs opened this issue 1 year ago • 1 comments

Preflight checklist

Ory Network Project

No response

Describe the bug

Hi, I was upgrading the kratos-client-go SDK version from v0.13.1 to v1.0.0. Upon upgrading, I found a bug regarding the returned struct of the UpdateRegistrationFlow function as it returns nil values.

Reproducing the bug

In the respSubmitFlow , the variable contains nil values. However, on inspecting resp, the body returns the information successfully.

       // ...
       // (usual flow of setting up kratos client)

	respSubmitFlow, resp, err := publicClient.FrontendApi.UpdateRegistrationFlow(ctx).
		Flow(flowId).UpdateRegistrationFlowBody(kratosClient.UpdateRegistrationFlowBody{
		UpdateRegistrationFlowWithPasswordMethod: &kratosClient.UpdateRegistrationFlowWithPasswordMethod{
			Method:   "password",
			Password: "Secured112233445",
			Traits: map[string]interface{}{
				"emails":       []string{email},
				"name_full":    "test namefull",
				"name_display": "test namedisplay",
			}},
	}).Execute()
	if err != nil {
		fmt.Println(err)
		return
	}

Relevant log output

No response

Relevant configuration

No response

Version

v1.0.0

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

These are the screenshots of our debugging process.

The pictures below you can see respSubmitFlow contains all the nil values. Whereas In resp, the raw body contains otherwise.

The values for respSubmitFlow image

The values for resp image

Gromitmugs avatar Jan 18 '24 05:01 Gromitmugs

Edit: Looks like the decode function could not unmarshal the raw body correctly image

Gromitmugs avatar Jan 18 '24 05:01 Gromitmugs