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();