Browse Source

Reuse two-factor cookie helper in shared test

pull/25304/head
maliming 4 months ago
parent
commit
a613e8899c
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 11
      modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/GetTwoFactorAuthenticationUser_Tests.cs

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

Loading…
Cancel
Save