Hi,
okay
Test is configured using the Production Redis db for now so that I can keep everything consistent for troubleshooting.
Don't use Production Redis db for Test env.
I think it's related to the session check.
you can try this to check if it's works:
[ExposeServices(typeof(IdentitySessionChecker))]
public class MyIdentitySessionChecker : IdentitySessionChecker
{
public MyIdentitySessionChecker(IOptions<AbpClaimsPrincipalFactoryOptions> abpClaimsPrincipalFactoryOption, IdentitySessionManager identitySessionManager, IDistributedCache<IdentitySessionCacheItem> cache, IClock clock, IWebClientInfoProvider webClientInfoProvider, IOptions<IdentitySessionCheckerOptions> options) : base(abpClaimsPrincipalFactoryOption, identitySessionManager, cache, clock, webClientInfoProvider, options)
{
}
public override Task<bool> IsValidateAsync(string sessionId)
{
return Task.FromResult(true);
//return base.IsValidateAsync(sessionId);
}
}
Hi,
you can use CSS
to change the style without any problem.
Sorry, I don't know what exact question is
Could you please share a minimal reproducible project with me? i will check it.
shiwei.liang@volosoft.com
Hi,
could you please share the full logs?
Hi,
You can override the IdentitySessionManager
to debug it step by step.
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IdentitySessionManager))]
public class MyIdentitySessionManager : IdentitySessionManager
{
public MyIdentitySessionManager(IIdentitySessionRepository identitySessionRepository, ICurrentUser currentUser, IDistributedCache<IdentitySessionCacheItem> cache, ISettingProvider settingProvider, IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache) : base(identitySessionRepository, currentUser, cache, settingProvider, identityDynamicClaimsPrincipalContributorCache)
{
}
public override async Task<IdentitySession> FindAsync(Guid id)
{
return await UpdateSessionFromCacheAsync(await IdentitySessionRepository.FindAsync(id));
}
public override async Task<IdentitySession> FindAsync(string sessionId)
{
return await UpdateSessionFromCacheAsync(await IdentitySessionRepository.FindAsync(sessionId));
}
protected override async Task<IdentitySession> UpdateSessionFromCacheAsync([CanBeNull] IdentitySession session)
{
if (session == null)
{
return null;
}
var sessionCacheItem = await Cache.GetAsync(session.SessionId);
if (sessionCacheItem != null && await UpdateSessionFromCacheAsync(session, sessionCacheItem))
{
await IdentitySessionRepository.UpdateAsync(session);
}
return session;
}
protected override Task<bool> UpdateSessionFromCacheAsync(IdentitySession session, IdentitySessionCacheItem sessionCacheItem)
{
if (session == null)
{
return Task.FromResult(false);
}
if (sessionCacheItem == null)
{
return Task.FromResult(false);
}
var changed = false;
if (sessionCacheItem.CacheLastAccessed != null && (session.LastAccessed == null || sessionCacheItem.CacheLastAccessed > session.LastAccessed))
{
session.UpdateLastAccessedTime(sessionCacheItem.CacheLastAccessed);
changed = true;
}
if (!sessionCacheItem.IpAddress.IsNullOrWhiteSpace())
{
var ipAddresses = session.GetIpAddresses().ToList();
ipAddresses.RemoveAll(x => x == sessionCacheItem.IpAddress);
ipAddresses.Add(sessionCacheItem.IpAddress);
session.SetIpAddresses(ipAddresses);
changed = true;
}
return Task.FromResult(changed);
}
}