[PM-31483] removing need for client fallback endpoint

This commit is contained in:
Alex Dragovich 2026-01-30 18:08:01 -08:00
parent 7142a6d7a0
commit 35907f0a53
2 changed files with 6 additions and 8 deletions

View File

@ -82,9 +82,7 @@ public class SendsController : Controller
throw new BadRequestException("Could not locate send");
}
/* This guard can be removed once feature flag is retired*/
var sendEmailOtpEnabled = _featureService.IsEnabled(FeatureFlagKeys.SendEmailOTP);
if (sendEmailOtpEnabled && send.AuthType == AuthType.Email && send.Emails is not null)
if (send.AuthType == AuthType.Email && send.Emails is not null)
{
return new UnauthorizedResult();
}
@ -137,9 +135,7 @@ public class SendsController : Controller
throw new BadRequestException("Could not locate send");
}
/* This guard can be removed once feature flag is retired*/
var sendEmailOtpEnabled = _featureService.IsEnabled(FeatureFlagKeys.SendEmailOTP);
if (sendEmailOtpEnabled && send.AuthType == AuthType.Email && send.Emails is not null)
if (send.AuthType == AuthType.Email && send.Emails is not null)
{
return new UnauthorizedResult();
}
@ -229,7 +225,6 @@ public class SendsController : Controller
}
[Authorize(Policy = Policies.Send)]
// [RequireFeature(FeatureFlagKeys.SendEmailOTP)] /* Uncomment once client fallback re-try logic is added */
[HttpPost("access/")]
public async Task<IActionResult> AccessUsingAuth()
{
@ -262,7 +257,6 @@ public class SendsController : Controller
}
[Authorize(Policy = Policies.Send)]
// [RequireFeature(FeatureFlagKeys.SendEmailOTP)] /* Uncomment once client fallback re-try logic is added */
[HttpPost("access/file/{fileId}")]
public async Task<IActionResult> GetSendFileDownloadDataUsingAuth(string fileId)
{
@ -274,6 +268,7 @@ public class SendsController : Controller
throw new BadRequestException("Could not locate send");
}
/* This guard can be removed once feature flag is retired*/
var sendEmailOtpEnabled = _featureService.IsEnabled(FeatureFlagKeys.SendEmailOTP);
if (!sendEmailOtpEnabled && send.AuthType == AuthType.Email && send.Emails is not null)
{

View File

@ -81,6 +81,9 @@ public class SendsControllerTests : IDisposable
send.Id = default;
send.Type = SendType.Text;
send.Data = JsonSerializer.Serialize(new Dictionary<string, string>());
send.AuthType = AuthType.None;
send.Emails = null;
send.EmailHashes = null;
send.HideEmail = true;
_sendRepository.GetByIdAsync(Arg.Any<Guid>()).Returns(send);