Abstraction of authenticators. Reworked Gmail authentication.

This commit is contained in:
Burak Kaan Köse
2024-11-20 01:45:48 +01:00
parent 8367efa174
commit 7fad15524f
44 changed files with 354 additions and 605 deletions

View File

@@ -83,6 +83,19 @@ namespace Wino.Server
services.AddSingleton<IServerMessageHandlerFactory>(serverMessageHandlerFactory);
// Server type related services.
// TODO: Better abstraction.
if (WinoServerType == WinoAppType.Mail)
{
services.AddSingleton<IAuthenticatorConfig, MailAuthenticatorConfiguration>();
}
else
{
// TODO: Calendar config will be added here.
}
return services.BuildServiceProvider();
}
@@ -135,6 +148,8 @@ namespace Wino.Server
{
string processName = WinoServerType == WinoAppType.Mail ? "Wino.Mail" : "Wino.Calendar";
var processs = Process.GetProcesses();
var proc = Process.GetProcessesByName(processName).FirstOrDefault() ?? throw new Exception($"{processName} client is not running.");
for (IntPtr appWindow = FindWindowEx(IntPtr.Zero, IntPtr.Zero, FRAME_WINDOW, null); appWindow != IntPtr.Zero;