|
|
|
|
@ -1,14 +1,10 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Http.Extensions;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Volo.Abp.AspNetCore.MultiTenancy;
|
|
|
|
|
using Volo.Abp.Auditing;
|
|
|
|
|
using Volo.Abp.Identity;
|
|
|
|
|
using Volo.Abp.MultiTenancy;
|
|
|
|
|
using Volo.Abp.Validation;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.Account.Web.Pages.Account
|
|
|
|
|
@ -53,49 +49,11 @@ namespace Volo.Abp.Account.Web.Pages.Account
|
|
|
|
|
[DisableAuditing]
|
|
|
|
|
public string ConfirmPassword { get; set; }
|
|
|
|
|
|
|
|
|
|
protected virtual ITenantResolveResultAccessor TenantResolveResultAccessor { get; }
|
|
|
|
|
|
|
|
|
|
protected virtual AbpAspNetCoreMultiTenancyOptions AspNetCoreMultiTenancyOptions { get; }
|
|
|
|
|
|
|
|
|
|
protected virtual AbpMultiTenancyOptions MultiTenancyOptions { get; }
|
|
|
|
|
|
|
|
|
|
public ResetPasswordModel(
|
|
|
|
|
ITenantResolveResultAccessor tenantResolveResultAccessor,
|
|
|
|
|
IOptions<AbpAspNetCoreMultiTenancyOptions> aspNetCoreMultiTenancyOptions,
|
|
|
|
|
IOptions<AbpMultiTenancyOptions> multiTenancyOptions)
|
|
|
|
|
{
|
|
|
|
|
TenantResolveResultAccessor = tenantResolveResultAccessor;
|
|
|
|
|
AspNetCoreMultiTenancyOptions = aspNetCoreMultiTenancyOptions.Value;
|
|
|
|
|
MultiTenancyOptions = multiTenancyOptions.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual Task<IActionResult> OnGetAsync()
|
|
|
|
|
{
|
|
|
|
|
if (MultiTenancyOptions.IsEnabled &&
|
|
|
|
|
TenantResolveResultAccessor.Result?.AppliedResolvers?.Contains(CookieTenantResolveContributor.ContributorName) == true)
|
|
|
|
|
if (SwitchTenant(TenantId))
|
|
|
|
|
{
|
|
|
|
|
if (CurrentTenant.Id != TenantId)
|
|
|
|
|
{
|
|
|
|
|
if (TenantId != null)
|
|
|
|
|
{
|
|
|
|
|
Response.Cookies.Append(
|
|
|
|
|
AspNetCoreMultiTenancyOptions.TenantKey,
|
|
|
|
|
TenantId.ToString(),
|
|
|
|
|
new CookieOptions
|
|
|
|
|
{
|
|
|
|
|
Path = "/",
|
|
|
|
|
HttpOnly = false,
|
|
|
|
|
Expires = DateTimeOffset.Now.AddYears(10)
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Response.Cookies.Delete(AspNetCoreMultiTenancyOptions.TenantKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.FromResult<IActionResult>(Redirect(HttpContext.Request.GetEncodedUrl()));
|
|
|
|
|
}
|
|
|
|
|
return Task.FromResult<IActionResult>(Redirect(HttpContext.Request.GetEncodedUrl()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.FromResult<IActionResult>(Page());
|
|
|
|
|
|