This commit is contained in:
2023-02-21 23:15:23 +00:00
parent 27a43e5e38
commit 7d8bbb651d
7 changed files with 806 additions and 792 deletions

View File

@@ -101,7 +101,7 @@ namespace Sockeye.Api.Controllers
TrialLicenseRequest o = await biz.CreateAsync(newObject);
if (o == null)
{
var msg = ($"Unexpected error (code SE-444 was returned to customer) processing a new trial license request:{biz.GetErrorsAsString}");
var msg = ($"Unexpected error (code SE-444 was returned to customer) processing a new trial license request:{biz.GetErrorsAsString}");
log.LogError(msg);
await NotifyEventHelper.AddOpsProblemEvent(msg);
return BadRequest($"E1000 - Error processing request code SE-444 contact support");//don't want to leak any info so need to check sockeye log if get this error
@@ -124,7 +124,7 @@ namespace Sockeye.Api.Controllers
//is there a valid trial request
var req = await ct.TrialLicenseRequest.AsNoTracking().Where(z => z.EmailConfirmCode == code && z.Status == TrialRequestStatus.AwaitingEmailValidation).FirstOrDefaultAsync();
var req = await ct.TrialLicenseRequest.AsNoTracking().Where(z => z.EmailConfirmCode == code).FirstOrDefaultAsync();//&& z.Status == TrialRequestStatus.AwaitingEmailValidation
if (req == null)
{
return new ContentResult
@@ -135,6 +135,18 @@ namespace Sockeye.Api.Controllers
};
}
//Legit code but they already validated email, if so then just return that it's ok so they don't keep thinking something's wrong
//but there's no need to keep processing it, it's done
if (req.EmailValidated)
{
return new ContentResult
{
ContentType = "text/html",
StatusCode = 200,
Content = "<html><body><h4>Email validated!</h4><p>Your request will be reviewed and processed by our staff <strong>during business hours</strong>. You will receive an email with instructions for starting your AyaNova evaluation.</p></body></html>"
};
}
TrialLicenseRequestBiz biz = TrialLicenseRequestBiz.GetBiz(ct);
var tlr = await biz.GetAsync(req.Id);
if (tlr == null)