The project is extremely big and complex for a support ticket. Server depends on 3rd party components (IndySecureMailClient, UniDAC units), the client is extremely big, full of files. I cannot easily compile neither of server nor client..
Can you please reduce it to a minimal focused on just reproducing the issue? That's also an exercise about understanding how things works and isolation possible influence on Sphinx from other code.
Nevertheless, I see your code calls Login twice. Why? I cannot run it because of the above, but you said login is called twice and you are calling the method twice, isn't it the obvious cause?
procedure TdmProMan.WebDataModuleCreate(Sender: TObject);
begin
userArgs:=nil;
if (not SphinxWebLogin.IsLoggedIn) then
with SphinxWebLogin do
begin
{
Authority:='http://178.254.40.246:2001/app/sphinx';
ClientId:='web';
RedirectUri:='http://178.254.40.246:2001/app/pm/';
scope:='openid email';
onUserLoggedIn:=SphinxWebLoginUserLoggedIn;
Login;
}
Login;
login;
end;
if sphinxWebLogin.IsLoggedIn then
Application.CreateForm(TStartForm, StartForm);
end;
Also, why are you creating the form in OnCreate, if you also creating it in OnUserLoggedIn?