From d70e61cb290187bda3fa5bbc37bb25bcd3c0591e Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Thu, 14 Sep 2023 01:16:34 +1000 Subject: Fix SignInAsync call --- Services/UserService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Services') diff --git a/Services/UserService.cs b/Services/UserService.cs index db62553..96f5b5f 100644 --- a/Services/UserService.cs +++ b/Services/UserService.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; using System.Runtime.InteropServices; using System.Security.Claims; using System.Security.Principal; @@ -42,7 +43,9 @@ public class UserService : IUserService { var claims = new Claim[] { }; - var claimsIdentity = new ClaimsIdentity(claims); + var claimsIdentity = new ClaimsIdentity( + claims, + CookieAuthenticationDefaults.AuthenticationScheme); var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); @@ -57,5 +60,8 @@ public class UserService : IUserService { } public void Logout() { + httpContextAccessor.HttpContext?.SignOutAsync() + .GetAwaiter() + .GetResult(); } } -- cgit v1.3