From bcccce72d18eb07b3603c492c72f49c19e8588fd Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 2 Jan 2021 23:57:59 +0100 Subject: [PATCH] Fixing old certification renewall --- Kyoo/Controllers/AuthManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kyoo/Controllers/AuthManager.cs b/Kyoo/Controllers/AuthManager.cs index 2be3d51e..287dad4f 100644 --- a/Kyoo/Controllers/AuthManager.cs +++ b/Kyoo/Controllers/AuthManager.cs @@ -34,6 +34,8 @@ namespace Kyoo.Controllers if (certificate.NotAfter.AddDays(7) <= DateTime.UtcNow) { Console.WriteLine("Signin certificate will expire soon, renewing it."); + if (File.Exists(OldCertificateFile)) + File.Delete(OldCertificateFile); File.Move(CertificateFile, OldCertificateFile); builder.AddValidationKey(GenerateCertificate(CertificateFile, configuration.GetValue("certificatePassword"))); }