Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emWebAppTemplate
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mac Stephens
emWebAppTemplate
Commits
fceb378c
Commit
fceb378c
authored
Mar 30, 2026
by
Mac Stephens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to login xdata connection error
parent
6ee6efe1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
22 deletions
+31
-22
ConnectionModule.pas
templateWebApp/ConnectionModule.pas
+3
-3
View.Login.pas
templateWebApp/View.Login.pas
+15
-9
templateXDataServer.ini
templateXDataServer/bin/templateXDataServer.ini
+1
-1
Auth.ServiceImpl.pas
templateXDataServer/source/Auth.ServiceImpl.pas
+1
-4
Common.Ini.pas
templateXDataServer/source/Common.Ini.pas
+0
-5
templateXDataServer.dproj
templateXDataServer/templateXDataServer.dproj
+11
-0
No files found.
templateWebApp/ConnectionModule.pas
View file @
fceb378c
...
@@ -4,7 +4,7 @@ interface
...
@@ -4,7 +4,7 @@ interface
uses
uses
System
.
SysUtils
,
System
.
Classes
,
WEBLib
.
Modules
,
XData
.
Web
.
Connection
,
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
type
TDMConnection
=
class
(
TWebDataModule
)
TDMConnection
=
class
(
TWebDataModule
)
...
@@ -73,8 +73,8 @@ var
...
@@ -73,8 +73,8 @@ var
errorMsg
:
string
;
errorMsg
:
string
;
begin
begin
errorMsg
:=
Error
.
ErrorMessage
;
errorMsg
:=
Error
.
ErrorMessage
;
if
errorMsg
=
''
then
if
errorMsg
=
'
Error connecting to XData server
'
then
errorMsg
:=
'
Connection error
'
;
errorMsg
:=
'
Error connecting to server. Please try again later.
'
;
if
Assigned
(
FUnauthorizedAccessProc
)
then
if
Assigned
(
FUnauthorizedAccessProc
)
then
FUnauthorizedAccessProc
(
errorMsg
)
FUnauthorizedAccessProc
(
errorMsg
)
...
...
templateWebApp/View.Login.pas
View file @
fceb378c
...
@@ -6,8 +6,7 @@ uses
...
@@ -6,8 +6,7 @@ uses
System
.
SysUtils
,
System
.
Classes
,
Web
,
WEBLib
.
Graphics
,
WEBLib
.
Controls
,
WEBLib
.
Forms
,
WEBLib
.
Dialogs
,
System
.
SysUtils
,
System
.
Classes
,
Web
,
WEBLib
.
Graphics
,
WEBLib
.
Controls
,
WEBLib
.
Forms
,
WEBLib
.
Dialogs
,
Vcl
.
Controls
,
Vcl
.
StdCtrls
,
WEBLib
.
StdCtrls
,
WEBLib
.
JSON
,
Vcl
.
Controls
,
Vcl
.
StdCtrls
,
WEBLib
.
StdCtrls
,
WEBLib
.
JSON
,
XData
.
Web
.
Client
,
WEBLib
.
ExtCtrls
,
Vcl
.
Imaging
.
pngimage
,
XData
.
Web
.
Client
,
WEBLib
.
ExtCtrls
,
Vcl
.
Imaging
.
pngimage
,
JS
,
XData
.
Web
.
Connection
,
JS
,
XData
.
Web
.
Connection
,
App
.
Types
,
ConnectionModule
;
App
.
Types
,
ConnectionModule
;
type
type
TFViewLogin
=
class
(
TWebForm
)
TFViewLogin
=
class
(
TWebForm
)
...
@@ -55,14 +54,21 @@ procedure TFViewLogin.btnLoginClick(Sender: TObject);
...
@@ -55,14 +54,21 @@ procedure TFViewLogin.btnLoginClick(Sender: TObject);
begin
begin
ShowNotification
(
'Login Error: '
+
AMsg
);
ShowNotification
(
'Login Error: '
+
AMsg
);
end
;
end
;
var
hashPW
:
string
;
procedure
AuthConnectionOpened
;
begin
AuthService
.
Login
(
edtUsername
.
Text
,
edtPassword
.
Text
,
DMConnection
.
clientVersion
,
@
LoginSuccess
,
@
LoginError
);
end
;
begin
begin
AuthService
.
Login
(
if
not
DMConnection
.
AuthConnection
.
Connected
then
edtUsername
.
Text
,
edtPassword
.
Text
,
DMConnection
.
clientVersion
,
DMConnection
.
AuthConnection
.
Open
(@
AuthConnectionOpened
)
@
LoginSuccess
,
else
@
LoginError
AuthConnectionOpened
;
);
end
;
end
;
class
procedure
TFViewLogin
.
Display
(
LoginProc
:
TSuccessProc
);
class
procedure
TFViewLogin
.
Display
(
LoginProc
:
TSuccessProc
);
...
...
templateXDataServer/bin/templateXDataServer.ini
View file @
fceb378c
[Settings]
[Settings]
MemoLogLevel
=
5
MemoLogLevel
=
5
FileLogLevel
=
5
FileLogLevel
=
5
LogFileNum
=
4
0
LogFileNum
=
4
4
DevMode
=
0
DevMode
=
0
webClientVersion
=
0.0.1
webClientVersion
=
0.0.1
...
...
templateXDataServer/source/Auth.ServiceImpl.pas
View file @
fceb378c
...
@@ -130,15 +130,12 @@ begin
...
@@ -130,15 +130,12 @@ begin
raise
EXDataHttpUnauthorized
.
Create
(
'Invalid username or password'
);
raise
EXDataHttpUnauthorized
.
Create
(
'Invalid username or password'
);
end
;
end
;
// ADD THIS DELETE BEFORE DEPLOY
passwordHash
:=
password
.
ToUpper
;
passwordHash
:=
password
.
ToUpper
;
storedHash
:=
AuthDb
.
uqUser
.
FieldByName
(
'user_password'
).
AsString
.
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;
// passwordHash := THashSHA2.GetHashString(username + password, THashSHA2.TSHA2Version.SHA256).ToUpper;
// storedHash := AuthDb.uqUser.FieldByName('user_password').AsString.ToUpper;
// storedHash := AuthDb.uqUser.FieldByName('user_password').AsString.ToUpper;
// STOP HERE DELETE BEFORE DEPLOY
if
storedHash
<>
passwordHash
then
if
storedHash
<>
passwordHash
then
begin
begin
...
...
templateXDataServer/source/Common.Ini.pas
View file @
fceb378c
...
@@ -8,13 +8,11 @@ uses
...
@@ -8,13 +8,11 @@ uses
type
type
TIniEntries
=
class
TIniEntries
=
class
private
private
// [Settings]
FConsoleLogLevel
:
Integer
;
FConsoleLogLevel
:
Integer
;
FFileLogLevel
:
Integer
;
FFileLogLevel
:
Integer
;
FLogFileNum
:
Integer
;
FLogFileNum
:
Integer
;
FJWTSecret
:
string
;
FJWTSecret
:
string
;
// [Database]
FDBServer
:
string
;
FDBServer
:
string
;
FDBPort
:
Integer
;
FDBPort
:
Integer
;
FDBDatabase
:
string
;
FDBDatabase
:
string
;
...
@@ -24,7 +22,6 @@ type
...
@@ -24,7 +22,6 @@ type
public
public
constructor
Create
;
constructor
Create
;
// Properties
property
consoleLogLevel
:
Integer
read
FConsoleLogLevel
;
property
consoleLogLevel
:
Integer
read
FConsoleLogLevel
;
property
fileLogLevel
:
Integer
read
FFileLogLevel
;
property
fileLogLevel
:
Integer
read
FFileLogLevel
;
property
logFileNum
:
Integer
read
FLogFileNum
;
property
logFileNum
:
Integer
read
FLogFileNum
;
...
@@ -59,12 +56,10 @@ var
...
@@ -59,12 +56,10 @@ var
begin
begin
iniFile
:=
TIniFile
.
Create
(
ChangeFileExt
(
Application
.
ExeName
,
'.ini'
));
iniFile
:=
TIniFile
.
Create
(
ChangeFileExt
(
Application
.
ExeName
,
'.ini'
));
try
try
// [Settings]
FConsoleLogLevel
:=
iniFile
.
ReadInteger
(
'Settings'
,
'ConsoleLogLevel'
,
3
);
FConsoleLogLevel
:=
iniFile
.
ReadInteger
(
'Settings'
,
'ConsoleLogLevel'
,
3
);
FFileLogLevel
:=
iniFile
.
ReadInteger
(
'Settings'
,
'FileLogLevel'
,
3
);
FFileLogLevel
:=
iniFile
.
ReadInteger
(
'Settings'
,
'FileLogLevel'
,
3
);
FLogFileNum
:=
iniFile
.
ReadInteger
(
'Settings'
,
'LogFileNum'
,
0
);
FLogFileNum
:=
iniFile
.
ReadInteger
(
'Settings'
,
'LogFileNum'
,
0
);
// [Database]
FDBServer
:=
iniFile
.
ReadString
(
'Database'
,
'Server'
,
'192.168.116.129'
);
FDBServer
:=
iniFile
.
ReadString
(
'Database'
,
'Server'
,
'192.168.116.129'
);
FDBPort
:=
iniFile
.
ReadInteger
(
'Database'
,
'Port'
,
0
);
FDBPort
:=
iniFile
.
ReadInteger
(
'Database'
,
'Port'
,
0
);
FDBDatabase
:=
iniFile
.
ReadString
(
'Database'
,
'Database'
,
'kg_order_entry'
);
FDBDatabase
:=
iniFile
.
ReadString
(
'Database'
,
'Database'
,
'kg_order_entry'
);
...
...
templateXDataServer/templateXDataServer.dproj
View file @
fceb378c
...
@@ -831,6 +831,9 @@
...
@@ -831,6 +831,9 @@
<Platform Name="Win64x">
<Platform Name="Win64x">
<Operation>1</Operation>
<Operation>1</Operation>
</Platform>
</Platform>
<Platform Name="WinARM64EC">
<Operation>1</Operation>
</Platform>
</DeployClass>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<Platform Name="iOSDevice32">
...
@@ -901,6 +904,10 @@
...
@@ -901,6 +904,10 @@
<RemoteDir>Assets</RemoteDir>
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
<Operation>1</Operation>
</Platform>
</Platform>
<Platform Name="WinARM64EC">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<Platform Name="Win32">
...
@@ -911,6 +918,10 @@
...
@@ -911,6 +918,10 @@
<RemoteDir>Assets</RemoteDir>
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
<Operation>1</Operation>
</Platform>
</Platform>
<Platform Name="WinARM64EC">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<Platform Name="iOSDevice64">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment