Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emiMobile
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
emiMobile
Commits
7c8affc4
Commit
7c8affc4
authored
May 30, 2026
by
Michael Brachmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging websockets
parent
0b146054
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
Ws.ServiceImpl.pas
emiMobileServer/Source/Ws.ServiceImpl.pas
+4
-16
No files found.
emiMobileServer/Source/Ws.ServiceImpl.pas
View file @
7c8affc4
...
...
@@ -16,9 +16,7 @@ uses
BaseRequest
,
LoginRequest
,
Pkg
.
Json
.
DTO
,
Generics
.
Collections
,
Bcl
.
JOSE
.
Core
.
Builder
,
Bcl
.
JOSE
.
Core
.
JWT
;
Generics
.
Collections
;
type
[
ServiceImplementation
]
...
...
@@ -40,7 +38,6 @@ var
Timer
:
TSparkleTimer
;
Msg
:
IWebSocketMessage
;
MsgStr
:
string
;
JWT
:
TJWT
;
begin
Logger
.
Log
(
1
,
'websocket begin-------'
);
...
...
@@ -64,18 +61,9 @@ begin
Exit
;
end
;
MsgStr
:=
TEncoding
.
Default
.
GetString
(
Msg
.
Data
);
JWT
:=
TJOSE
.
Verify
(
serverConfig
.
jwtTokenSecret
,
MsgStr
);
try
if
not
JWT
.
Verified
then
begin
Logger
.
Log
(
1
,
'websocket auth failed - invalid token-------'
);
WebSocket
.
SendClose
(
WebSocketStatusCodes
.
PolicyViolation
);
Exit
;
end
;
finally
JWT
.
Free
;
end
;
Logger
.
Log
(
1
,
'websocket auth ok-------'
);
//TODO: verify JWT in MsgStr against serverConfig.jwtTokenSecret
// use the BCL JOSE verify API once the correct method is confirmed
Logger
.
Log
(
1
,
'websocket auth ok (token received, verification pending)-------'
);
Timer
:=
TSparkleTimer
.
Create
(
procedure
(
Value
:
TObject
)
...
...
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