SphinxWebLogin is invoked 2 times before the user is logged in.
After the first time log in with a valid mail and password, SphinxWebLogin UserLoginArgs:=nil. SphinxWebLogin will automatically start a second time. After re-entering email address and password, UserLoginArgs has vaild user data.
HandleOAuth is set to false.
In the HTML debugger of the Browser I don't get an error.
I tested the whole thing with the SphinxWebLogin parameters both in the object inspector and directly in the source code. Neither resulted in any change.
Source of Main Program:
program pm;
{$R *.dres}
uses
Vcl.Forms,
WEBLib.Forms,
proMan in 'proMan.pas' {StartForm: TWebForm} {*.html},
proman_user_profile in 'proman_user_profile.pas' {UserProfileForm: TWebForm} {*.html},
proman_orders in 'proman_orders.pas' {OrdersForm: TWebForm} {*.html},
proman_datenmodul in 'proman_datenmodul.pas' {dmProMan: TWebDataModule},
uFrame in 'uFrame.pas' {MenuFrame: TFrame};
{$R *.res}
begin
Application.HandleOAuth := false;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TdmProMan, dmProMan);
Application.CreateForm(TStartForm, StartForm);
Application.Run;
end.
And here is the source code with the "SphinxWebLogin".
I've placed the SphinxWebLogin to a datamodule. This data module is created as the first unit in the main program.
ShowMessage user LoggedIn will only be displayed after the 2nd call to SphinxWebLogin.
unit proman_datenmodul;
interface
uses
System.SysUtils, System.Classes, JS,
Web,
WEBLib.Dialogs,
WEBLib.Modules, Sphinx.WebLogin;
type
TdmProMan = class(TWebDataModule)
SphinxWebLogin: TSphinxWebLogin;
procedure WebDataModuleCreate(Sender: TObject);
procedure SphinxWebLoginUserLoggedIn(Args: TUserLoggedInArgs);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
UserArgs: TUserLoggedInArgs;
end;
var
dmProMan: TdmProMan;
implementation
{%CLASSGROUP 'Vcl.Controls.TControl'}
{$R *.dfm}
procedure TdmProMan.SphinxWebLoginUserLoggedIn(Args: TUserLoggedInArgs);
begin
ShowMessage('User Logged in');
userArgs:=Args;
end;
procedure TdmProMan.WebDataModuleCreate(Sender: TObject);
begin
userArgs:=nil;
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;
end;
end;
end.
I've tried everything, but I just can't get anywhere at this point.
I'm grateful for any help.