gentle-xylophone-92591
10/08/2024, 1:14 PMno value given for required property error
fmt.Println(params)
result, resp, err := s.kc.FrontendAPI.UpdateRecoveryFlow(ctx).Flow(params.FlowId).UpdateRecoveryFlowBody(
kratos.UpdateRecoveryFlowWithCodeMethodAsUpdateRecoveryFlowBody(&kratos.UpdateRecoveryFlowWithCodeMethod{
Email: params.Email,
Code: params.Code,
CsrfToken: ¶ms.CsrfToken,
Method: "code",
}),
).Cookie(cookie).Execute()
if err != nil {
fmt.Println(err)
return "", fmt.Errorf("%s", err)
}
payload contains flowId
, csrfToken
and code
brief-egg-61061
10/08/2024, 1:14 PMbrief-egg-61061
10/08/2024, 1:15 PMUpdateRecoveryFlow
method, the required properties are method
and email
for the UpdateRecoveryFlowWithLinkMethod
, and method
for the UpdateRecoveryFlowWithCodeMethod
. From your code, it seems you are using the UpdateRecoveryFlowWithCodeMethod
and you have provided the method
property. However, you mentioned that your payload contains flowId
, csrfToken
, and code
, but there's no mention of email
. According to the [Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api), the email
property is described as follows: > "The email address of the account to recover. If the email belongs to a valid account, a recovery email will be sent." Even though the email
property is not marked as required for the UpdateRecoveryFlowWithCodeMethod
, the description suggests that it should be provided when you want to recover an account. If you're trying to recover an account using a code, you should include the email
property in your payload. Here's how you can modify your code: go result, resp, err := s.kc.FrontendAPI.UpdateRecoveryFlow(ctx).Flow(params.FlowId).UpdateRecoveryFlowBody( kratos.UpdateRecoveryFlowWithCodeMethodAsUpdateRecoveryFlowBody(&kratos.UpdateRecoveryFlowWithCodeMethod{ Email: params.Email, Code: params.Code, CsrfToken: ¶ms.CsrfToken, Method: "code", }), ).Cookie(cookie).Execute()
Please ensure that params.Email
is correctly set in your payload. If you're still encountering issues, I would recommend checking the exact error message and the status code returned by the API for more specific details about what might be going wrong.gentle-xylophone-92591
10/08/2024, 1:17 PMemail
on payload will resend recovery code email, I already have the code I dont want to resend it again, I want flow to proceedgentle-xylophone-92591
10/08/2024, 1:18 PMemail
on payload will resend recovery code email, I already have the code I dont want to resend it again, I want flow to proceedbrief-egg-61061
10/08/2024, 1:18 PMbrief-egg-61061
10/08/2024, 1:18 PMemail
field in your payload. According to the [Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api), including the email
field in the payload will invalidate the sent code and re-send a new code. Here's how you can modify your code: go result, resp, err := s.kc.FrontendAPI.UpdateRecoveryFlow(ctx).Flow(params.FlowId).UpdateRecoveryFlowBody( kratos.UpdateRecoveryFlowWithCodeMethodAsUpdateRecoveryFlowBody(&kratos.UpdateRecoveryFlowWithCodeMethod{ Code: params.Code, CsrfToken: ¶ms.CsrfToken, Method: "code", }), ).Cookie(cookie).Execute()
In this code, only the Code
, CsrfToken
, and Method
fields are included in the payload. The email
field is not included, so the recovery code email will not be resent.gentle-xylophone-92591
10/08/2024, 1:21 PMno value given for required property error
brief-egg-61061
10/08/2024, 1:21 PMbrief-egg-61061
10/08/2024, 1:22 PM4000002
as per the [Kratos UI Messages documentation](https://www.ory.sh/docs/kratos/concepts/ui-messages#property-property-is-missing-4000002). json { "id": 4000002, "text": "Property {property} is missing.", "type": "error", "context": { "property": "{property}" } }
The {property}
placeholder in the error message will be replaced with the name of the property that is missing. In your case, you're using the UpdateRecoveryFlowWithCodeMethod
and you've provided the Code
, CsrfToken
, and Method
properties. If you're still getting the error, it might be due to one of these properties not being set correctly in your params
or the FlowId
not being set correctly in the UpdateRecoveryFlow
method. Please ensure that all these properties are correctly set in your request. If you're still encountering issues, I would recommend checking the exact error message and the status code returned by the API for more specific details about what might be going wrong.