End Livestream completes the session: StopStream clears the OAuth session and DPAPI token (crash-safe sign-out)

This commit is contained in:
2026-08-06 11:50:50 -07:00
parent 4afe11e718
commit d97b5d375c
7 changed files with 30 additions and 4 deletions
+12
View File
@@ -71,4 +71,16 @@ public class YouTubeAuthServiceTests
Assert.InRange(service.CurrentChannel.TokenExpiry,
DateTime.UtcNow.AddSeconds(3590), DateTime.UtcNow.AddSeconds(3610));
}
[Fact]
public void ClearSession_DropsCurrentChannel()
{
var service = CreateService("""{"access_token":"a","refresh_token":"r","expires_in":3600}""",
"""{"items":[]}""");
service.SetSession(new YouTubeChannel { DisplayName = "Test Channel" });
service.ClearSession();
Assert.Null(service.CurrentChannel);
}
}