Switched to Device code authentication

This commit is contained in:
2026-01-17 18:32:57 +01:00
parent 881ec1c0ec
commit 19c27c8ef0
4 changed files with 17 additions and 15 deletions

View File

@@ -5,6 +5,8 @@ namespace OneDriveBackupService;
public class Worker(ILogger<Worker> logger, ConfigData config, OneDriveClient client) : BackgroundService {
protected override async Task ExecuteAsync(CancellationToken stoppingToken) {
await client.EnsureAuthenticated(stoppingToken);
if (Environment.GetCommandLineArgs().Contains("--run-once")) {
logger.LogInformation("Manual backup triggered");
await RunBackup(DateTime.Now, stoppingToken);