Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. protected async Task LoginTest()
  2. {
  3. await _SignInManager.SignInAsync(new ApplicationUser()
  4. { UserName = "test@test.com" }, true);
  5. UriHelper.NavigateTo("/", true);
  6. }
  7.  
  8. System.InvalidOperationException: The response headers cannot be modified because the response has already started.
  9. at Microsoft.AspNetCore.HttpSys.Internal.HeaderCollection.ThrowIfReadOnly()
  10. at Microsoft.AspNetCore.HttpSys.Internal.HeaderCollection.set_Item(String key, StringValues value)
  11. at Microsoft.AspNetCore.Http.Internal.ResponseCookies.Append(String key, String value, CookieOptions options)
  12. at Microsoft.AspNetCore.Authentication.Cookies.ChunkingCookieManager.AppendResponseCookie(HttpContext context, String key, String value, CookieOptions options)
  13. at Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties properties)
  14. at Microsoft.AspNetCore.Authentication.AuthenticationService.SignInAsync(HttpContext context, String scheme, ClaimsPrincipal principal, AuthenticationProperties properties)
  15. at Microsoft.AspNetCore.Identity.SignInManager`1.SignInWithClaimsAsync(TUser user, AuthenticationProperties authenticationProperties, IEnumerable`1 additionalClaims)
  16. at WebApplication3.Pages.Account.Login.RegUser() in C:UsersdavidsourcereposWebApplication3WebApplication3PagesAccountLogin.razor:line 28
  17. at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
  18. at Microsoft.AspNetCore.Components.Rendering.Renderer.GetErrorHandledTask(Task taskToHandle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement