Where are you loading your javascript? Are you loading your javascript file on the index (Titulos pagar) page?
Fixed by applying https://github.com/aspnetzero/aspnet-zero-core/issues/1609!
I still have this issue. I just sent you a sample project again in which you can see what goes wrong. The email is from [email protected].
Thanks,
Bart
@luqc1985 Does switching back to the host (using the "Back to my account" button) from any other tenants works too?
Actually fixed it. The application URL changed in IIS, so what happened was that on impersonated login the url went from http://a.blabla to http://b.blabla. Which works on most browsers but not on Safari.
<cite>ismcagdas: </cite> @michelmk2 this is strange. UserLinkManager class is craeted via dependency injection, so UserManager on it also created via DI.
I couldn't understand why UserManager is null when switching back to host.
If this is a repeatable problem on your project, could you share your project via email ?
Thanks, I will somewhere next week!
<cite>ismcagdas: </cite> In that case, you need to do something like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1608#issuecomment-418185262">https://github.com/aspnetzero/aspnet-ze ... -418185262</a> and use it like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1608#issuecomment-418211767">https://github.com/aspnetzero/aspnet-ze ... -418211767</a>.
If you follow that approach, you can reserve a keyword (host for example) for the host website.
Would I add those things in the *.web.mvc project or in the *.web.host project?
Thanks!
EDIT: Okay so the domainresolver works. When I log go to host.{domain}.com, I can login to the host environment. Still when you use linked accounts to switch to {subdomain}.{domain} and then back to {host}.{domain}, you will recieve an error:
System.ArgumentNullException: Value cannot be null.
Parameter name: user
at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory`1.<CreateAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AbpUserClaimsPrincipalFactory`2.<CreateAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__5`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Robin.Authorization.Users.UserLinkManager.<GetSwitchedUserAndIdentity>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Robin.Web.Controllers.AccountController.<SwitchToLinkedAccountSignIn>d__55.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__5`1.MoveNext()
--- End of stack trace from previous ...
<cite>alper: </cite>
<cite>aamoretti: </cite> Please set me as well. Thank you.
done for you @aamoretti
Can you reset my permissions as well? THanks!
<cite>ismcagdas: </cite> @michelmk2 sorry for our late response. This is strange. If you comment out the code I have suggested, it should take you back to old case.
Did you make additional changes on the project regarding to this problem ?
Unfortunately I'm still having the same problem. Tried all kinds of things.
I just discovered that the error I'm getting is because in the UserLinkManager.cs, method GetSwitchedUserAndIdentity, the _userManager is null, therefore it crashes and I get the error the the value cannot be null. The _userManager in the UserLinkManager class is not empty when I switch between tenants (subdomainds) it ONLY happens when I switch back to the host. :(.
Any idea why it's empty when switch back to the host? Thanks!!
<cite>ismcagdas: </cite> @michelmk2 does it work like it used to be when you comment out the line below ?
Configuration.MultiTenancy.Resolvers.Insert(0,new MyDomainTenantResolveContributor());
That gives me the same error as above :(.