cleanup
This commit is contained in:
@ -36,7 +36,7 @@ namespace Oqtane.Infrastructure
|
||||
var user = jwtManager.ValidateToken(token, secret, sitesettings.GetValue("JwtOptions:Issuer", ""), sitesettings.GetValue("JwtOptions:Audience", ""));
|
||||
if (user != null)
|
||||
{
|
||||
// populate principal (reload user roles to ensure most accurate permission assigments)
|
||||
// populate principal (reload user roles to ensure most accurate permissions)
|
||||
var _userRoles = context.RequestServices.GetService(typeof(IUserRoleRepository)) as IUserRoleRepository;
|
||||
var principal = (ClaimsIdentity)context.User.Identity;
|
||||
UserSecurity.ResetClaimsIdentity(principal);
|
||||
@ -52,7 +52,8 @@ namespace Oqtane.Infrastructure
|
||||
}
|
||||
}
|
||||
|
||||
await _next(context);
|
||||
// continue processing
|
||||
if (_next != null) await _next(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ namespace Oqtane.Infrastructure
|
||||
{
|
||||
internal class TenantMiddleware
|
||||
{
|
||||
private readonly RequestDelegate next;
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
public TenantMiddleware(RequestDelegate next)
|
||||
{
|
||||
this.next = next;
|
||||
_next = next;
|
||||
}
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
@ -55,7 +55,7 @@ namespace Oqtane.Infrastructure
|
||||
}
|
||||
|
||||
// continue processing
|
||||
if (next != null) await next(context);
|
||||
if (_next != null) await _next(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Infrastructure
|
||||
{
|
||||
@ -20,21 +19,7 @@ namespace Oqtane.Infrastructure
|
||||
{
|
||||
var cache = map.GetOrAdd(GetKey(), new OptionsCache<TOptions>());
|
||||
cache.Clear();
|
||||
}
|
||||
|
||||
public void Clear(Alias alias)
|
||||
{
|
||||
var cache = map.GetOrAdd(alias.SiteKey, new OptionsCache<TOptions>());
|
||||
|
||||
cache.Clear();
|
||||
}
|
||||
|
||||
public void ClearAll()
|
||||
{
|
||||
foreach (var cache in map.Values)
|
||||
{
|
||||
cache.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public TOptions GetOrAdd(string name, Func<TOptions> createOptions)
|
||||
|
Reference in New Issue
Block a user