mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Created sso config service with save (#936)
This commit is contained in:
29
src/Core/Services/Implementations/SsoConfigService.cs
Normal file
29
src/Core/Services/Implementations/SsoConfigService.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Repositories;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class SsoConfigService : ISsoConfigService
|
||||
{
|
||||
private readonly ISsoConfigRepository _ssoConfigRepository;
|
||||
|
||||
public SsoConfigService(
|
||||
ISsoConfigRepository ssoConfigRepository)
|
||||
{
|
||||
_ssoConfigRepository = ssoConfigRepository;
|
||||
}
|
||||
|
||||
public async Task SaveAsync(SsoConfig config)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
config.RevisionDate = now;
|
||||
if (config.Id == default)
|
||||
{
|
||||
config.CreationDate = now;
|
||||
}
|
||||
await _ssoConfigRepository.UpsertAsync(config);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user