0
walkerscott created
Hi,
How can I set the tenant based on URL?
Scenario is an email is sent to the users with the URL to access specific page. The URL has an identifier that can let us know what tenant the URL is for. In our case GUID.
What we want is upon accessing the URL, if not logged in, it will set the Tenant on TenancyName on Login Page. So that the page will not lose the return URL as well.
I was able to set the Tenant but I can't write the cookie for Abp.TenantId. I write it on SessionAppService.GetCurrentLoginInformations(), but can't write the cookie from it.
My code for writing the cookie is below..
_httpContextAccessor.HttpContext.Response.Cookies.Append(
"Abp.TenantId",
userUrlTenantId.ToString(),
new CookieOptions
{
Expires = DateTimeOffset.Now.AddYears(5),
Path = "/"
}
);
2 Answer(s)
-
0
Okay I got it already.. So i found the app-session.service.ts, and I set the cookie from there.
abp.multiTenancy.setTenantIdCookie(result.tenant.id);
-
0
good to hear it works