예제 #1
0
        public async Task <ActionResult> Login(string userNameOrEmailAddress = "", string returnUrl = "", string successMessage = "", string ss = "")
        {
            returnUrl = NormalizeReturnUrl(returnUrl);

            if (!string.IsNullOrEmpty(ss) && ss.Equals("true", StringComparison.OrdinalIgnoreCase) && AbpSession.UserId > 0)
            {
                var updateUserSignInTokenOutput = await _sessionAppService.UpdateUserSignInToken();

                returnUrl = AddSingleSignInParametersToReturnUrl(returnUrl, updateUserSignInTokenOutput.SignInToken, AbpSession.UserId.Value, AbpSession.TenantId);
                return(Redirect(returnUrl));
            }

            ViewBag.ReturnUrl             = returnUrl;
            ViewBag.IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled;
            ViewBag.SingleSignIn          = ss;

            return(View(
                       new LoginFormViewModel
            {
                IsSelfRegistrationEnabled = IsSelfRegistrationEnabled(),
                IsTenantSelfRegistrationEnabled = IsTenantSelfRegistrationEnabled(),
                SuccessMessage = successMessage,
                UserNameOrEmailAddress = userNameOrEmailAddress
            }));
        }