LoginAsync is filtering on tenant. Bug? #68
Hey there, I've run into a snag. I need to use multi-tenant and I'm trying to complete the login mechanism.
Here's the problem -- by default it seems that AbpSession.TenantId = 1. The TenantId is set to 1 even if you haven't logged in yet.
This is fine, but the problem is _userManager.LoginAsync appears to be filtering based on TenantId. I don't think this makes much sense. You can't filter on Tenant if the Tenant is set to 1.
I tested this by first being able to successfully login with a username and password if the user's TenantId was 1. I then changed the user's TenantId to 2 and I get InvalidUserNameOrEmailAddress.
Unless it's my responsibility to set the tenant session prior to running LoginAsync? That doesn't make sense either since I should only set the tenant upon a successful login.
LoginAsync should not filter on tenant in my opinion, unless I am doing something terribly wrong. Please let me know.
Nope, my bad!
For anyone who runs into a similar problem, you need to enable MultiTenancy in your WebModule file like this:
Hope that helps.