Skip to content

Commit

Permalink
Adjusted Access Violation without TSession Class set
Browse files Browse the repository at this point in the history
  • Loading branch information
hunsche committed Jul 9, 2019
1 parent c52582d commit a42ff71
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Horse.JWT.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
LJSON := LJWT.GetClaims.JSON;

if Assigned(SessionClass) then
begin
LSession := SessionClass.Create;
TJson.JsonToObject(LSession, LJSON);
end
LSession := SessionClass.Create
else
LSession := LJSON;
LSession := TJSONValue.Create;

TJson.JsonToObject(LSession, LJSON);

THorseHackRequest(Req).SetSession(LSession);

Expand Down Expand Up @@ -97,4 +96,4 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
end;
end;

end.
end.

0 comments on commit a42ff71

Please sign in to comment.