End Livestream completes the session: StopStream clears the OAuth session and DPAPI token (crash-safe sign-out)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user