Login is smarter now

This commit is contained in:
Matt Nadareski
2026-02-28 11:06:08 -05:00
parent a433cc6ff1
commit 1caa784210
6 changed files with 12 additions and 10 deletions

View File

@@ -65,8 +65,7 @@ namespace RedumpTool.Features
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
// Login to Redump, if necessary
if (!_client.LoggedIn)
_client.Login(username, password).Wait();
_client.Login(username, password).Wait();
// Start the processing
var processingTask = _client.DownloadPacks(outDir, useSubfolders);

View File

@@ -89,8 +89,7 @@ namespace RedumpTool.Features
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
// Login to Redump, if necessary
if (!_client.LoggedIn)
_client.Login(username, password).Wait();
_client.Login(username, password).Wait();
// Start the processing
Task<List<int>> processingTask;

View File

@@ -89,8 +89,7 @@ namespace RedumpTool.Features
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
// Login to Redump, if necessary
if (!_client.LoggedIn)
_client.Login(username, password).Wait();
_client.Login(username, password).Wait();
// Start the processing
Task<List<int>> processingTask;

View File

@@ -72,8 +72,7 @@ namespace RedumpTool.Features
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
// Login to Redump, if necessary
if (!_client.LoggedIn)
_client.Login(username, password).Wait();
_client.Login(username, password).Wait();
// Start the processing
Task<List<int>> processingTask;

View File

@@ -84,8 +84,7 @@ namespace RedumpTool.Features
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
// Login to Redump, if necessary
if (!_client.LoggedIn)
_client.Login(username, password).Wait();
_client.Login(username, password).Wait();
// Start the processing
Task<List<int>> processingTask;

View File

@@ -116,6 +116,13 @@ namespace SabreTools.RedumpLib.Web
/// <returns>True if the user could be logged in, false otherwise, null on error</returns>
public async Task<bool?> Login(string username, string password)
{
// Check for already logged in
if (LoggedIn)
{
Console.WriteLine("Already logged in!");
return true;
}
// Credentials verification
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
{