public async Task LinkToUser(LinkToUserInput input) { var loginResult = await _logInManager.LoginAsync(input.UsernameOrEmailAddress, input.Password, input.TenancyName); if (loginResult.Result != AbpLoginResultType.Success) { throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result, input.UsernameOrEmailAddress, input.TenancyName); } if (AbpSession.IsUser(loginResult.User)) { throw new UserFriendlyException(L("YouCannotLinkToSameAccount")); } if (loginResult.User.ShouldChangePasswordOnNextLogin) { throw new UserFriendlyException(L("ChangePasswordBeforeLinkToAnAccount")); } await _userLinkManager.Link(GetCurrentUser(), loginResult.User); }