From a613e8899c7096f2a17c0e516eda750e0c0b76b9 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 22 Apr 2026 17:26:39 +0800 Subject: [PATCH] Reuse two-factor cookie helper in shared test --- .../GetTwoFactorAuthenticationUser_Tests.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/GetTwoFactorAuthenticationUser_Tests.cs b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/GetTwoFactorAuthenticationUser_Tests.cs index 6bdb71a12a..3ce774ff81 100644 --- a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/GetTwoFactorAuthenticationUser_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/GetTwoFactorAuthenticationUser_Tests.cs @@ -31,16 +31,7 @@ public class GetTwoFactorAuthenticationUser_Tests : SharedAbpIdentityAspNetCoreT await uow.CompleteAsync(); } - var writeResponse = await Client.GetAsync($"/api/signin-test/write-two-factor-cookie?userId={tenantUserId}"); - writeResponse.EnsureSuccessStatusCode(); - - if (writeResponse.Headers.TryGetValues("Set-Cookie", out var setCookies)) - { - foreach (var cookie in setCookies) - { - Client.DefaultRequestHeaders.Add("Cookie", cookie.Split(';').First()); - } - } + await WriteTwoFactorCookieAsync(tenantUserId); var getResponse = await Client.GetAsync("/api/signin-test/get-two-factor-user"); getResponse.EnsureSuccessStatusCode();