fix(EnvelopedLocked): asp-for tag helper verwendet, um die Daten der UserSelectSMS Eigenschaft zu erhalten.

- nullibility und null check von UserSelectSMS entfernt, weil es für tag helper nicht akzeptabel ist
This commit is contained in:
Developer 02
2024-12-10 20:13:26 +01:00
parent 6a6da39bc4
commit 76bd1a102f
3 changed files with 12 additions and 13 deletions

View File

@@ -226,17 +226,7 @@ namespace EnvelopeGenerator.Web.Controllers
//check if the user has phone is added
if (er_secret.TFAEnabled)
{
if (auth.UserSelectSMS is bool userSelectSMS)
return await TFAView(userSelectSMS);
else
{
// if If TFA is enabled but UserSelectSMS is null, there is an unauthorized request(e.g. via an application like postman)
Response.StatusCode = StatusCodes.Status401Unauthorized;
_logger.LogError("TFA is enabled but UserSelectSMS is null. In this case there is an unauthorized request (for example via an application like postman). Form data: {form}", JsonConvert.SerializeObject(auth));
return this.ViewInnerServiceError();
}
}
return await TFAView(auth.UserSelectSMS);
}
else if (auth.HasSmsCode)
{