feat: add logging for empty secret
This commit is contained in:
parent
c12323dc29
commit
c66f3355ec
@ -145,7 +145,13 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
|
|||||||
case TwoFactorAuthenticator.Totp:
|
case TwoFactorAuthenticator.Totp:
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(firstTokenAuth.Secret))
|
if (string.IsNullOrEmpty(firstTokenAuth.Secret))
|
||||||
|
{
|
||||||
|
logger.LogWarning("The user {Fingerprint} for {UserId} tried to pass the 2FA even though the secret is empty",
|
||||||
|
requestContext.Fingerprint,
|
||||||
|
firstTokenAuth.UserId);
|
||||||
|
|
||||||
throw new InvalidOperationException("Required authentication data is missing.");
|
throw new InvalidOperationException("Required authentication data is missing.");
|
||||||
|
}
|
||||||
|
|
||||||
var totp = new TotpService(firstTokenAuth.Secret);
|
var totp = new TotpService(firstTokenAuth.Secret);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user