Commit fceb378c by Mac Stephens

Update to login xdata connection error

parent 6ee6efe1
......@@ -4,7 +4,7 @@ interface
uses
System.SysUtils, System.Classes, WEBLib.Modules, XData.Web.Connection,
App.Types, App.Config, XData.Web.Client, WEBLib.Dialogs;
App.Types, App.Config, XData.Web.Client, WEBLib.Dialogs, Utils;
type
TDMConnection = class(TWebDataModule)
......@@ -73,8 +73,8 @@ var
errorMsg: string;
begin
errorMsg := Error.ErrorMessage;
if errorMsg = '' then
errorMsg := 'Connection error';
if errorMsg = 'Error connecting to XData server' then
errorMsg := 'Error connecting to server. Please try again later.';
if Assigned(FUnauthorizedAccessProc) then
FUnauthorizedAccessProc(errorMsg)
......
......@@ -6,8 +6,7 @@ uses
System.SysUtils, System.Classes, Web, WEBLib.Graphics, WEBLib.Controls, WEBLib.Forms, WEBLib.Dialogs,
Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls, WEBLib.JSON,
XData.Web.Client, WEBLib.ExtCtrls, Vcl.Imaging.pngimage,
JS, XData.Web.Connection,
App.Types, ConnectionModule;
JS, XData.Web.Connection, App.Types, ConnectionModule;
type
TFViewLogin = class(TWebForm)
......@@ -55,14 +54,21 @@ procedure TFViewLogin.btnLoginClick(Sender: TObject);
begin
ShowNotification('Login Error: ' + AMsg);
end;
var
hashPW: string;
begin
procedure AuthConnectionOpened;
begin
AuthService.Login(
edtUsername.Text, edtPassword.Text, DMConnection.clientVersion,
@LoginSuccess,
@LoginError
);
end;
begin
if not DMConnection.AuthConnection.Connected then
DMConnection.AuthConnection.Open(@AuthConnectionOpened)
else
AuthConnectionOpened;
end;
class procedure TFViewLogin.Display(LoginProc: TSuccessProc);
......
[Settings]
MemoLogLevel=5
FileLogLevel=5
LogFileNum=40
LogFileNum=44
DevMode=0
webClientVersion=0.0.1
......
......@@ -130,15 +130,12 @@ begin
raise EXDataHttpUnauthorized.Create('Invalid username or password');
end;
// ADD THIS DELETE BEFORE DEPLOY
passwordHash := password.ToUpper;
storedHash := AuthDb.uqUser.FieldByName('user_password').AsString.ToUpper;
// STOP HERE DELETE BEFORE DEPLOY
// REMOVE THIS DELETE BEFORE DEPLOY
// passwordHash := THashSHA2.GetHashString(username + password, THashSHA2.TSHA2Version.SHA256).ToUpper;
// storedHash := AuthDb.uqUser.FieldByName('user_password').AsString.ToUpper;
// STOP HERE DELETE BEFORE DEPLOY
if storedHash <> passwordHash then
begin
......
......@@ -8,13 +8,11 @@ uses
type
TIniEntries = class
private
// [Settings]
FConsoleLogLevel: Integer;
FFileLogLevel: Integer;
FLogFileNum: Integer;
FJWTSecret: string;
// [Database]
FDBServer: string;
FDBPort: Integer;
FDBDatabase: string;
......@@ -24,7 +22,6 @@ type
public
constructor Create;
// Properties
property consoleLogLevel: Integer read FConsoleLogLevel;
property fileLogLevel: Integer read FFileLogLevel;
property logFileNum: Integer read FLogFileNum;
......@@ -59,12 +56,10 @@ var
begin
iniFile := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try
// [Settings]
FConsoleLogLevel := iniFile.ReadInteger('Settings', 'ConsoleLogLevel', 3);
FFileLogLevel := iniFile.ReadInteger('Settings', 'FileLogLevel', 3);
FLogFileNum := iniFile.ReadInteger('Settings', 'LogFileNum', 0);
// [Database]
FDBServer := iniFile.ReadString('Database', 'Server', '192.168.116.129');
FDBPort := iniFile.ReadInteger('Database', 'Port', 0);
FDBDatabase := iniFile.ReadString('Database', 'Database', 'kg_order_entry');
......
......@@ -831,6 +831,9 @@
<Platform Name="Win64x">
<Operation>1</Operation>
</Platform>
<Platform Name="WinARM64EC">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
......@@ -901,6 +904,10 @@
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="WinARM64EC">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
......@@ -911,6 +918,10 @@
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="WinARM64EC">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment