Base solution for your next web application
Open Closed

Change password on login - previously selected tenant is not selected anymore #11484


User avatar
0
alexanderpilhar created

12.0.0, Angular

Problem Changing the password on next login results in an error as the selected tenant is not selected anymore on the enter-new-password-page.

Expected behaviour Expected to keep the selected tenant selected on enter-new-password-page.

How to reproduce

  • Add new user.
  • Make sure change password on next login is checked.
  • Wait for activation mail and click the link or manually select the correct tenant on login page.
  • See the correct tenant being selected as expected.
  • Login with the credentials for the new user.
  • Get redirected to enter-new-password-page.
  • See the previously selected tenant not being selected anymore.
  • Enter new password.
  • See error message (internal server error).

7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @alexanderpilhar

    Normally, selected tenant should be stored in cookies. Do you use a different approach for determining the tenant or do you use the not modified template ?

  • User Avatar
    0
    alexanderpilhar created

    Hi @ismcagdas!

    I use the login approach as shipped with ASPNETZERO.

    I wanted to try again using ASPNETZERO demo application but there is a problem with the certificate it seems (ERR_SSL_VERSION_OR_CIPHER_MISMATCH).

  • User Avatar
    0
    alexanderpilhar created

    Also, URL seems to be okay - the tenant-id is correct there: https://.../account/reset-password?tenantId=1&c=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    But the form says there is no tenant selected... And sending the forms leads to an error message...

  • User Avatar
    0
    alexanderpilhar created

    And this is the error logged:

    ERROR 2023-03-01 09:01:40,258 [39 ] Mvc.ExceptionHandling.AbpExceptionFilter - There is no user with id: 189
    Abp.AbpException: There is no user with id: 189
    at Abp.Authorization.Users.AbpUserManager`2.GetUserByIdAsync(Int64 userId)
    at Company.Name.Authorization.Accounts.AccountAppService.ResetPassword(ResetPasswordInput input) in D:\User.Name\source\repos\Company.Name.All\Core\src\Company.Name.Application\Authorization\Accounts\AccountAppService.cs:line 144
    at lambda_method9990(Closure, Object)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, 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)
    
  • User Avatar
    1
    m.aliozkaya created
    Support Team

    Hi alexanderpilhar,

    Could you update your project to the next version? It seems fixed here https://github.com/aspnetzero/aspnet-zero-core/issues/4718

  • User Avatar
    0
    alexanderpilhar created

    Hi @m.aliozkaya!

    I'll give it a try and see if it fixes the issue!

  • User Avatar
    0
    alexanderpilhar created

    I can confirm the linked commit fixes the issue!

    Thank you very much!