- ABP Framework version: v7.4.0
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
I deleted the tenant and created it again with the same name, I added the admin and another user to the new one, but when clicking switch tenant and entering the name, the tenant_ID that is retrieved in the cookie is the one of the deleted account which doesn’t have the employees trying to login it won’t allow them to login. I tried clearing cookies, force refresh, didn’t help, once you enter the tenant name, it retrieved the ID of the deleted one.
I try this code but it's not work
Configure<AbpAspNetCoreMultiTenancyOptions>(options =>
{
options.MultiTenancyMiddlewareErrorPageBuilder = async (httpContext, exception) =>
{
foreach (var cookie in httpContext.Request.Cookies)
{
httpContext.Response.Cookies.Delete(cookie.Key);
}
httpContext.Response.Redirect(httpContext.Request.Path);
return true;
};
});
Please help to resolve this.
Thanks
5 Answer(s)
-
0
Hi,
Could you share the full steps to reproduce the problem? thanks.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thank you for support. I shared steps to reproduce:
- I created new tenant "ABCD" and login with default tenant's admin
- I deleted the tenant "ABCD" and re-create new tenant with same name "ABCD"
- I try to login with tenant "ABCD" but when clicking switch tenant and entering the name, the tenant_ID that is retrieved in the cookie is the one of the deleted account which doesn’t have the users trying to login it won’t allow them to login
Thank you
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
It works for me:
You can see the video https://drive.google.com/file/d/10APitqORLwtrMYb7MAo4J8W-XWsMmxYg/view?usp=sharing
Configure<AbpAspNetCoreMultiTenancyOptions>(options => { options.MultiTenancyMiddlewareErrorPageBuilder = async (httpContext, exception) => { foreach (var cookie in httpContext.Request.Cookies) { httpContext.Response.Cookies.Delete(cookie.Key); } httpContext.Response.Redirect(httpContext.Request.GetEncodedPathAndQuery()); return true; }; });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi
It's not working for me this code
Configure<AbpAspNetCoreMultiTenancyOptions>(options => { options.MultiTenancyMiddlewareErrorPageBuilder = async (httpContext, exception) => { foreach (var cookie in httpContext.Request.Cookies) { httpContext.Response.Cookies.Delete(cookie.Key); } httpContext.Response.Redirect(httpContext.Request.GetEncodedPathAndQuery()); return true; }; });I have follow all steps from your video. thank you
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Could you share a simple project via email that can reproduce the problem with me? I will check it. shiwei.liang@volosoft.com
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)