Thanks, that worked. Peja
Thanks, what is the easiest way of doing that? I've sent mail to [email protected] Thanks, Peja
Hi,
We removed tenant from the login screen and followed your instruction about from: https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Core-Angular-Sign-In-Without-Specifying-Tenant
Recently we tried setting user flag 'should change password on next login'. After authentication user is correctly redirected to the screen to change password, however when they attempt to do it we see following error:
ERROR 2022-06-10 06:04:41,070 [3 ] Mvc.ExceptionHandling.AbpExceptionFilter - There is no user with id: 7
Abp.AbpException: There is no user with id: 7
at Abp.Authorization.Users.AbpUserManager`2.GetUserByIdAsync(Int64 userId)
at DenvrDashboard.Authorization.Accounts.AccountAppService.ResetPassword(ResetPasswordInput input) in C:\Users\PejaRadojkovic\workspace\denvrdata\DenvrDashboard\aspnet-core\src\DenvrDashboard.Application\Authorization\Accounts\AccountAppService.cs:line 138
at lambda_method2024(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Can you please advice how to resolve the issue. Thanks, Peja
Thanks. Than I guess we can close this ticket. Maybe, you guys can update the instructions for removing tenant from the login screen based on this ticket? For us, not forcing users to select tenant on the login is very useful feature from user experience point. Regards, Predrag
As you can see on the screenshot, the value is 2 which corresponds to globex tenant. Initially it worked, but once I was logged in as globex tenant and I went back to Host it is still showing TenandId cookie to be 2.
I tried logging in using both id (admin) or email ([email protected]) and in both cases I am getting same error
Hi,
We decided to remove tenant from the login screen and followed your instruction about from: https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Core-Angular-Sign-In-Without-Specifying-Tenant
It mostly went well, our users have unique emails andlogging in with emails works file. We configured logging in via Ldap for some tenatns, and this works fine as well.
There was however one issue:
when I logged in as a host admin, I would be logged in correctly but I was not able to use "Tenants -> Login as this Tenant" functionality. I was getting "You are not logged in as a host user!"
I dig up a bit, and found the error in tenants.components.ts in showUserImpersonateLookUpModal(record: any) method.
I commented out the check that caused the error, and thigs seem ok now, but I wanted to check with you guys if this is right way:
showUserImpersonateLookUpModal(record: any): void {
// if (abp.multiTenancy.getTenantIdCookie()) {
// this.message.warn(this.l('YouAreNotLoggedInAsAHostUser')).then(() => {
// document.location.reload();
// });
// return;
// }
this.impersonateUserLookupModal.tenantId = record.id;
this.impersonateUserLookupModal.show();
}
Thanks, Predrag
In the meanwhile I managed to get around issue #2 by changing external link opening functionality in side-bar-menu.component.html like this:
<a
*ngIf="!item.items.length && item.external"
href="#"
(click)=openInNewTab(item.route)
class="menu-link menu-toggle"
>
<ng-container
[ngTemplateOutlet]="mMenuItemText"
[ngTemplateOutletContext]="{ item: item, parentItem: parentItem }"
></ng-container>
</a>
... and defining openInNewTab() method in side-bar-menu.component.ts:
openInNewTab(url) {
window.open(url, '_blank').focus();
}
However It is still not clear to me why the existing functionality to opening external links in side-bar-menu.component.html won't work, and at the same time, very similar code in top-bar-menu.component.html works fine. Anyhow, hopefully you guys can provide some insight.
Also, one more issue found:
3. Dockerfile.original in aspnet-core stil references aspnet 5.0
It worked fine when I changed it to 6.0
Thanks and Regards, Peja
1. Issue with Timestamp fields in PostgreSQL
Hi, I tried today migrating to latest version of the framework (11.0.1) end there are couple of issues
We are usign PostgreSQL as a DB. After switching to .NET core 6.0 I also upgraded Npgsql.EntityFrameworkCore.PostgreSQL to version 6. When I started aspnet-core part, I got error:
InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported
I was able to get around the issue by adding this into Configure() method of Startup.cs but I am not sure if this is correct way to do it.
// workaround for issue when switched to .NET 6.0: 'InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported'
// solution found here: https://stackoverflow.com/questions/69961449/net6-and-datetime-problem-cannot-write-datetime-with-kind-utc-to-postgresql-ty
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
2. Links that suppose to open in new tab do not work in Default Theme, but work in Theme 2
One of the Menu items we added is link to external web page that opens in new tab. To achieve this we set externalLink to true in AppMenuItem:
new AppMenuItem('Helpdesk - New Tab', 'Pages.Tenant.Helpdesk.InNewTab', 'flaticon-book', 'https://EXTERNAL_URL_HERE', [], [], true)
Nothing happens when this menu item is clicked. Nothing is recorded in Console as well.
However, if I pick 'Theme 2', external link is correctly opened in new link. Can you please take a look and advice if this is right way to achieve opening external URL in a new tab.
Another minor issue is that although I downloaded version 11.0.1, version strings in the app still say: 11.0.0
Thanks and Regards, Predrag
Thanks, information sent. Predrag