diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts index 5bcdd52003..96ee2e355a 100644 --- a/src/app/core/auth/server-auth.service.ts +++ b/src/app/core/auth/server-auth.service.ts @@ -28,7 +28,7 @@ export class ServerAuthService extends AuthService { headers = headers.append('Accept', 'application/json'); headers = headers.append('Authorization', `Bearer ${token.accessToken}`); // NB this is used to pass server client IP check. - const clientIp = this.req.get('x-forwarded-for'); + const clientIp = this.req.get('x-forwarded-for') || this.req.connection.remoteAddress; headers = headers.append('X-Forwarded-For', clientIp); options.headers = headers;