From 655c60b505937ab26ea63f06b61b3a0dcc9ab312 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Sat, 30 May 2020 06:23:23 -0600 Subject: [PATCH] Log out of the Mega client before logging in --- CHANGELOG.md | 3 +++ Wabbajack.Lib/Downloaders/MEGADownloader.cs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa51493..9d208555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - 2.0.8.0 - ?? +* Make sure the MEGA client is logged out before logging in (#881) + #### Version - 2.0.7.0 - 5/28/2020 * Code is now robust when dealing with invasive Anti-virus software. We'll retry deletes/opens if the file is in use * Rework HTTP retries for all sites to reduce the amount of 503 errors we get from LL diff --git a/Wabbajack.Lib/Downloaders/MEGADownloader.cs b/Wabbajack.Lib/Downloaders/MEGADownloader.cs index 657ddcdb..4a1fb2c0 100644 --- a/Wabbajack.Lib/Downloaders/MEGADownloader.cs +++ b/Wabbajack.Lib/Downloaders/MEGADownloader.cs @@ -53,6 +53,15 @@ namespace Wabbajack.Lib.Downloaders { MegaApiClient.AuthInfos authInfos; + try + { + MegaApiClient.Logout(); + } + catch (NotSupportedException ex) + { + // Not logged in, so ignore + } + try { authInfos = MegaApiClient.GenerateAuthInfos(username, password.ToNormalString(), mfa);