1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-01 17:52:17 -05:00

only tracking TOTPs in cache (#3275)

This commit is contained in:
Ike 2023-09-15 13:38:56 -07:00 committed by GitHub
parent 8b30b3c7fd
commit cd0f8ce411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,8 @@ public abstract class BaseRequestValidator<T> where T : class
}
return;
}
if (twoFactorProviderType != TwoFactorProviderType.Remember)
// We only want to track TOTPs in the chache to enforce one time use.
if (twoFactorProviderType == TwoFactorProviderType.Authenticator || twoFactorProviderType == TwoFactorProviderType.Email)
{
await Core.Utilities.DistributedCacheExtensions.SetAsync(_distributedCache, cacheKey, twoFactorToken, _cacheEntryOptions);
}