Fix migration & OIDC not saving
This commit is contained in:
parent
626bb3b719
commit
4c397e0af0
2 changed files with 2 additions and 10 deletions
|
@ -10,12 +10,6 @@ namespace API.Data.Migrations
|
|||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ExternalId",
|
||||
table: "AspNetUsers",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Owner",
|
||||
table: "AspNetUsers",
|
||||
|
@ -27,10 +21,6 @@ namespace API.Data.Migrations
|
|||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExternalId",
|
||||
table: "AspNetUsers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Owner",
|
||||
table: "AspNetUsers");
|
||||
|
|
|
@ -421,6 +421,7 @@ public class SettingsService : ISettingsService
|
|||
throw new KavitaException("oidc-invalid-authority");
|
||||
}
|
||||
setting.Value = updateSettingsDto.OidcConfig.Authority;
|
||||
Configuration.OidcAuthority = updateSettingsDto.OidcConfig.Authority;
|
||||
_unitOfWork.SettingsRepository.Update(setting);
|
||||
_logger.LogWarning("OIDC Authority is changing, clearing all external ids");
|
||||
await _oidcService.ClearOidcIds();
|
||||
|
@ -430,6 +431,7 @@ public class SettingsService : ISettingsService
|
|||
if (setting.Key == ServerSettingKey.OidcClientId && setting.Value != updateSettingsDto.OidcConfig.ClientId)
|
||||
{
|
||||
setting.Value = updateSettingsDto.OidcConfig.ClientId;
|
||||
Configuration.OidcClientId = updateSettingsDto.OidcConfig.ClientId;
|
||||
_unitOfWork.SettingsRepository.Update(setting);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue