From a336aeb007c9c35c6e13ced60794cabea56e1347 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Wed, 2 Aug 2023 07:50:42 -0400 Subject: [PATCH] fix(server): get remote ip (#3515) --- server/src/immich/app.guard.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/immich/app.guard.ts b/server/src/immich/app.guard.ts index f104fe7bda..60857451bf 100644 --- a/server/src/immich/app.guard.ts +++ b/server/src/immich/app.guard.ts @@ -61,14 +61,14 @@ export const AuthUser = createParamDecorator((data, ctx: ExecutionContext): Auth }); export const GetLoginDetails = createParamDecorator((data, ctx: ExecutionContext): LoginDetails => { - const req = ctx.switchToHttp().getRequest(); + const req = ctx.switchToHttp().getRequest(); const userAgent = UAParser(req.headers['user-agent']); return { - clientIp: req.clientIp, + clientIp: req.ip, isSecure: req.secure, - deviceType: userAgent.browser.name || userAgent.device.type || req.headers.devicemodel || '', - deviceOS: userAgent.os.name || req.headers.devicetype || '', + deviceType: userAgent.browser.name || userAgent.device.type || (req.headers.devicemodel as string) || '', + deviceOS: userAgent.os.name || (req.headers.devicetype as string) || '', }; });