Disable password auth setting

This commit is contained in:
Amelia 2025-06-30 15:54:36 +02:00
parent 1180d518a2
commit 188020597c
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
20 changed files with 164 additions and 75 deletions

View file

@ -366,8 +366,10 @@ public class SettingsService : ISettingsService
var url = authority + "/.well-known/openid-configuration";
try
{
await url.GetJsonAsync<OpenIdConnectConfiguration>();
return true;
//await url.GetJsonAsync<OpenIdConnectConfiguration>();
//return true;
var res = await url.GetAsync();
return res.StatusCode == 200;
}
catch (Exception e)
{
@ -455,6 +457,13 @@ public class SettingsService : ISettingsService
_unitOfWork.SettingsRepository.Update(setting);
}
if (setting.Key == ServerSettingKey.DisablePasswordAuthentication &&
updateSettingsDto.OidcConfig.DisablePasswordAuthentication + string.Empty != setting.Value)
{
setting.Value = updateSettingsDto.OidcConfig.DisablePasswordAuthentication + string.Empty;
_unitOfWork.SettingsRepository.Update(setting);
}
}
private void UpdateEmailSettings(ServerSetting setting, ServerSettingDto updateSettingsDto)