Activities of "liangshiwei"

Could you please share a minimal reproducible project with me? i will check it.

shiwei.liang@volosoft.com

Hi,

I just think there is something wrong with your project structure.

For Auth Server Separated solution, the Blazor.Server project should not rely on Volo.Abp.Identity.Pro.Domain project.

Hi

If session is not null, then the check will pass

Hi,

could you please share the full logs?

Hi,

sure, please email me. i will share it with you.

shiwei.liang@volosoft.com

BTW, you can download it via ABP CLI abp get-source Volo.Saas

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);
    }
}

HI,

This is the full method code

protected virtual async Task CheckSizeAsync(long contentLength)
{
    if (contentLength > FileDescriptorConsts.MaxSizeLength)
    {
        throw new UserFriendlyException(L["FileTooBig", BeautifySize(FileDescriptorConsts.MaxSizeLength)]); ;
    }

    var maxSizeDescription = await FeatureChecker.GetOrNullAsync(FileManagementFeatures.StorageSize);

    if (maxSizeDescription == null || maxSizeDescription == "0")
    {
        return;
    }

    var maxSize = long.Parse(maxSizeDescription);

    var totalStorage = await FileDescriptorRepository.GetTotalSizeAsync();

    if ((totalStorage + contentLength) < maxSize)
    {
        return;
    }

    var remainedSize = (maxSize - totalStorage);
    throw new NotEnoughStorageSizeException(BeautifySize(maxSize), BeautifySize(remainedSize));
}

https://abp.io/docs/latest/release-info/migration-guides/abp-8-3#angular-ui

Yes, you are right, we will update the document, you ticket was refunded

You can read these documents to understand it

https://abp.io/docs/latest/framework/fundamentals/connection-strings https://abp.io/docs/latest/framework/architecture/multi-tenancy

Showing 281 to 290 of 5944 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11