@chilly-king-10285 this is my code publicasync Task<KratosVerificationFlow?> VerificationCode(string email)
{
var emailDto =await _unitOfWork.Email.GetByEmail(email);
if (emailDto ==null)
{
throw new InvalidOperationException();
}
var apiInstance =new FrontendApi(_config);
var flow =await CreateVerificationFlow();
if (flow ==null)
{
return null;
}
try
{
//KratosUpdateVerificationFlowWithCodeMethod verificationWithCode = new KratosUpdateVerificationFlowWithCodeMethod(null, null, email, kratosUpdateVerificationFlowWithCodeMethod.MethodEnum.Link);
KratosUpdateVerificationFlowWithLinkMethod verificationWithCode =new KratosUpdateVerificationFlowWithLinkMethod(null, email, KratosUpdateVerificationFlowWithLinkMethod.MethodEnum.Link);
KratosUpdateVerificationFlowBody verificationBody =new KratosUpdateVerificationFlowBody(verificationWithCode);
var result =await apiInstance.UpdateVerificationFlowAsync(
flow.Id, verificationBody);
//var results = await apiInstance.up
Debug.WriteLine(result);
return result;
}
catch (ApiException e)
{
Debug.Print("Exception when calling FrontendApi.UpdateVerificationFlow: "+ e.Message);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
return null;
}
}
there i am trying to verify through link that sould triggr on given mail
publicasync Task<KratosVerificationFlow> CreateVerificationFlow()
{
var apiInstance =new FrontendApi(_config);
try
{
var result =await apiInstance.CreateNativeVerificationFlowAsync();
return result;
}
catch (ApiException e)
{
Debug.Print("Exception when calling FrontendApi.CreateVerificationFlow: "+ e.Message);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
return null;
}
}
this is how I am getting verification flow id
Ory.Kratos.Client.Client.ApiException
HResult=0x80131500
Message=Error calling UpdateVerificationFlow: {"id":"0f6eec94-9c9b-4a2b-a523-c2d0db339cc7","type":"api","expires_at":"2024-03-19T13
0503.165581Z","issued_at":"2024-03-19T12
0503.165581Z","request_url":"
http://127.0.0.1:4433/self-service/verification/api","active":"default","ui":{"action":"
http://127.0.0.1:4433/self-service/verification?flow=0f6eec94-9c9b-4a2b-a523-c2d0db339cc7","method":"POST","nodes":[{"type":"input","group":"code","attributes":{"name":"email","type":"email","value":"
shailja.dobriyal@unthinkable.co","required":true,"disabled":false,"node_type":"input"},"messages":[],"meta":{"label":{"id":1070007,"text":"Email","type":"info"}}},{"type":"input","group":"code","attributes":{"name":"method","type":"submit","value":"code","disabled":false,"node_type":"input"},"messages":[],"meta":{"label":{"id":1070005,"text":"Submit","type":"info"}}},{"type":"input","group":"default","attributes":{"name":"csrf_token","type":"hidden","value":"","required":true,"disabled":false,"node_type":"input"},"messages":[],"meta":{}}],"messages":[{"id":4010006,"text":"Could not find a strategy to verify your account with. Did you fill out the form correctly?","type":"error"}]},"state":"choose_method"}
Source=Ory.Kratos.Client
StackTrace:
at Ory.Kratos.Client.Api.FrontendApi.<UpdateVerificationFlowWithHttpInfoAsync>d__140.MoveNext()
at Ory.Kratos.Client.Api.FrontendApi.<UpdateVerificationFlowAsync>d__139.MoveNext()
at Focus.BLL.Services.KratosService.KratosService.<VerificationCode>d__12.MoveNext() in C:\Users\user\Documents\Reform project\Azure login\focus-reform-backend\aeg_business_layer\Focus.BLL\Services\KratosService\KratosService.cs:line 313
This exception was originally thrown at this call stack:
[External Code]
Focus.BLL.Services.KratosService.KratosService.VerificationCode(string) in KratosService.cs
i am getting this error
What i am doing wrong