Skip to content

Commit

Permalink
fix getClientRequestIPsInfo types
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Dec 21, 2024
1 parent fc246db commit 35cb1bb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/Auth/AuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { DB, DBHandlerServer, Prostgles } from "../Prostgles";
import {
Auth,
AuthClientRequest,
AuthResult,
AuthResultOrError,
AuthResultWithSID,
BasicSession,
Expand Down
10 changes: 6 additions & 4 deletions lib/Auth/utils/getClientRequestIPsInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { AuthClientRequest, LoginClientInfo } from "../AuthTypes";
export const getClientRequestIPsInfo = <T extends AuthClientRequest>(
req: T
): T & LoginClientInfo => {
import { PRGLIOSocket } from "../../DboBuilder/DboBuilderTypes";
import { ExpressReq, LoginClientInfo } from "../AuthTypes";
type ClientReq =
| { socket: PRGLIOSocket; httpReq?: undefined }
| { httpReq: ExpressReq; socket?: undefined };
export const getClientRequestIPsInfo = <T extends ClientReq>(req: T): T & LoginClientInfo => {
if (req.httpReq) {
const ip_address = req.httpReq.ip;
if (!ip_address) throw new Error("ip_address missing from req.httpReq");
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.193",
"version": "4.2.194",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 35cb1bb

Please sign in to comment.