Base solution for your next web application
Open Closed

Mutli-tenancy implementation and AbpSession #436


User avatar
0
valeriy created

Hi User logged in the application first time. He doesn't have tenant yet. I need to refresh AbpSession.TenantId when user creates his profile in the application. At this moment I create new tenant for this user and don't want to logout this user from the application. Please advice how I can do it. Thanks


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    It's not intented to be used like that. A User must have TenantId set while user is being created as shown in the template: <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/AccountController.cs#L169">https://github.com/aspnetboilerplate/mo ... er.cs#L169</a>

    If user's TenantId is null, he is considered as HOST user. We should not convert a host user to a tenant user normally.