Base solution for your next web application

Activities of "alfar_re"

Hi,

Great. Hoping for a resolution soon.

Hi,

Well received. I appreciate it.

Hi,

I recently upgraded my license to include one extra project. It went through and I received the extra license. However, there was no email or invoice received so I have nothing to send to finance to record the transaction. Kindly sort this out since it has taken too long.

Hi @ismcagdas,

Kindly confirm receipt of the email. I need to close this matter by tomorrow since there are a few development tasks being delayed by it. Please. Thank you.

Hi **@ismcagdas **,

I've reshared the link on mail with the same subject. Kindly check it.

Thank you.

Hi @ismcagdas,

Any assistance with this issue will be highly appreciated. This issue is affecting a deliverable.

Hi @ismcagdas,

The email subject is the same as the title of this issue

AUTOMATICALLY DETECT TENANT ON LOGIN #9608

Hi @ismcagdas,

Any help will be appreciated. I'm really stuck on this one.

Hi,

I shared the project with you. I'm really stuck and would appreciate a resolution. Thanks.

Hi @ismcagdas

Here you go.

public virtual async Task<JsonResult> Login(LoginViewModel loginModel, string returnUrl = "", string returnUrlHash = "", string ss = "") 
        {
            returnUrl = NormalizeReturnUrl(returnUrl);
            if (!string.IsNullOrWhiteSpace(returnUrlHash))
            {
                returnUrl = returnUrl + returnUrlHash;
            }

            if (UseCaptchaOnLogin())
            {
                await _recaptchaValidator.ValidateAsync(HttpContext.Request.Form[RecaptchaValidator.RecaptchaResponseKey]);
            }

            var usr = await _accountAppService.IsTenantAvailable(new IsTenantAvailableInput
            {
                TenancyName = loginModel.UsernameOrEmailAddress
            });

            var userTenantId = usr.TenantId;

            var tenancyNameOrNull = userTenantId.HasValue ? _tenantCache.GetOrNull((int)userTenantId)?.TenancyName : null;

            var loginResult = await GetLoginResultAsync(loginModel.UsernameOrEmailAddress, loginModel.Password, tenancyNameOrNull);
            //
            if (!string.IsNullOrEmpty(ss) && ss.Equals("true", StringComparison.OrdinalIgnoreCase) && loginResult.Result == AbpLoginResultType.Success)
            {
                loginResult.User.SetSignInToken();
                returnUrl = AddSingleSignInParametersToReturnUrl(returnUrl, loginResult.User.SignInToken, loginResult.User.Id, loginResult.User.TenantId);
            }

            if (_settingManager.GetSettingValue<bool>(AppSettings.UserManagement.AllowOneConcurrentLoginPerUser))
            {
                await _userManager.UpdateSecurityStampAsync(loginResult.User);
            }

            if (loginResult.User.ShouldChangePasswordOnNextLogin)
            {
                loginResult.User.SetNewPasswordResetCode();

                return Json(new AjaxResponse
                {
                    TargetUrl = Url.Action(
                        "ResetPassword",
                        new ResetPasswordViewModel
                        {
                            TenantId = AbpSession.TenantId,
                            UserId = loginResult.User.Id,
                            ResetCode = loginResult.User.PasswordResetCode,
                            ReturnUrl = returnUrl,
                            SingleSignIn = ss
                        })
                });
            }

            var signInResult = await _signInManager.SignInOrTwoFactorAsync(loginResult, loginModel.RememberMe);
            if (signInResult.RequiresTwoFactor)
            {
                return Json(new AjaxResponse
                {
                    TargetUrl = Url.Action(
                        "SendSecurityCode",
                        new
                        {
                            returnUrl = returnUrl,
                            rememberMe = loginModel.RememberMe
                        })
                });
            }

            Debug.Assert(signInResult.Succeeded);

            await UnitOfWorkManager.Current.SaveChangesAsync();

            return Json(new AjaxResponse { TargetUrl = returnUrl });
        }
Showing 41 to 50 of 138 entries