From b6584cdc3bbb674871eea69da36778d70f9eb308 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 24 Apr 2026 12:06:43 +0800 Subject: [PATCH] address copilot review: narrow catch to ConcurrencyFailure; doc CodeLength range --- .../Abp/Identity/AspNetCore/AbpTwoFactorTokenProvider.cs | 7 +++++-- .../AspNetCore/AbpTwoFactorTokenProviderOptions.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProvider.cs b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProvider.cs index f4a596c433..c0cd005890 100644 --- a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProvider.cs +++ b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProvider.cs @@ -1,5 +1,6 @@ using System; using System.Globalization; +using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; @@ -125,12 +126,14 @@ public abstract class AbpTwoFactorTokenProvider : IUserTwoFactorTokenProvider e.Code == nameof(IdentityErrorDescriber.ConcurrencyFailure))) { return false; } diff --git a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProviderOptions.cs b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProviderOptions.cs index 6cda812195..973d677091 100644 --- a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProviderOptions.cs +++ b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpTwoFactorTokenProviderOptions.cs @@ -7,6 +7,6 @@ public abstract class AbpTwoFactorTokenProviderOptions /// Default: 3 minutes. public TimeSpan TokenLifespan { get; set; } = TimeSpan.FromMinutes(3); - /// Default: 6. + /// Default: 6. Valid range: 1 to 9 (inclusive). public int CodeLength { get; set; } = 6; }