Skip to content

Commit

Permalink
fix: SSO Environment Lost,issues 1183 (#1290)
Browse files Browse the repository at this point in the history
* fix: Domain account synchronization backend execution and logic adjustment

* close popups

* fix: Generate Staff during Ldap login

* fix: issues 1269、1237、1226

* fix:issuers 1183、1128

* fix: Environment lost
  • Loading branch information
wzh425 authored May 6, 2024
1 parent cb50b9a commit 222f8ec
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task GetProjectListAsync(ProjectListQuery query)
public async Task GetProjectUIAppListAsync(ProjectUIAppListQuery query)
{
query.Result = await GetProjectDtoListAsync(_multiEnvironmentUserContext.Environment, AppTypes.UI);
var menuPermissions = await _permissionRepository.GetListAsync(p => p.Type == PermissionTypes.Menu
var menuPermissions = await _permissionRepository.GetListAsync(p => p.Enabled && p.Type == PermissionTypes.Menu
|| p.Type == PermissionTypes.Element);
query.Result.SelectMany(p => p.Apps).ToList().ForEach(a =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the Apache License. See LICENSE.txt in the project root for license information.

namespace Masa.Auth.Service.Admin.Application.Sso.Commands;

public class AddCustomLoginCommandValidator : AbstractValidator<AddCustomLoginCommand>
{
public AddCustomLoginCommandValidator() => RuleFor(cmd => cmd.CustomLogin).SetValidator(new AddCustomLoginValidator());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the Apache License. See LICENSE.txt in the project root for license information.

namespace Masa.Auth.Service.Admin.Application.Sso.Commands;

public class UpdateCustomLoginCommandValidator : AbstractValidator<UpdateCustomLoginCommand>
{
public UpdateCustomLoginCommandValidator() => RuleFor(cmd => cmd.CustomLogin).SetValidator(new UpdateCustomLoginValidator());
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ public async Task AddCustomLoginAsync(FormContext context)
OpenErrorMessage(T("Register configuration items are required"));
return;
}
if (!CustomLogin.RegisterFields.Any(r => (r.RegisterFieldType == RegisterFieldTypes.PhoneNumber || r.RegisterFieldType == RegisterFieldTypes.Email) && r.Required))
{
Tab = CustomLoginTab.Register;
OpenErrorMessage(T("PhoneNumberAndEmailEmptyError"));
return;
}

await CustomLoginService.AddAsync(CustomLogin);
OpenSuccessMessage(T("Add Custom Login success"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public async Task UpdateCustomLoginAsync(FormContext context)
OpenErrorMessage(T("Register configuration items are required"));
return;
}
if (!CustomLogin.RegisterFields.Any(r => (r.RegisterFieldType == RegisterFieldTypes.PhoneNumber || r.RegisterFieldType == RegisterFieldTypes.Email) && r.Required))
{
Tab = CustomLoginTab.Register;
OpenErrorMessage(T("PhoneNumberAndEmailEmptyError"));
return;
}

await CustomLoginService.UpdateAsync(CustomLogin);
OpenSuccessMessage(T("Edit Custom Login data success"));
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Masa.Auth.Web.Sso/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var masaStackConfig = builder.Services.GetMasaStackConfig();

// Add services to the container.
builder.Services.AddScoped<EnvironmentDataService>();
builder.Services.AddSingleton<EnvironmentDataService>();
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddMasaBlazor(builder =>
Expand Down

0 comments on commit 222f8ec

Please sign in to comment.