replaced IConfiguration injection with IConfigHelper

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-14 09:54:13 -07:00
parent 8c6920afab
commit 8d74799099
16 changed files with 137 additions and 71 deletions

View File

@@ -113,11 +113,17 @@ namespace CarCareTracker.Middleware
}
else
{
if (!_loginLogic.CheckIfUserIsValid(authCookie.UserData.Id))
{
return AuthenticateResult.Fail("Cookie points to non-existant user.");
}
//validate if user is still valid
var appIdentity = new ClaimsIdentity("Custom");
var userIdentity = new List<Claim>
{
new(ClaimTypes.Name, authCookie.UserData.UserName),
new(ClaimTypes.NameIdentifier, authCookie.UserData.Id.ToString())
new(ClaimTypes.NameIdentifier, authCookie.UserData.Id.ToString()),
new(ClaimTypes.Role, "CookieAuth")
};
if (authCookie.UserData.IsAdmin)
{