@actual-app/sync-server 26.1.0-nightly.20251213 → 26.1.0-nightly.20251214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,6 @@ import { getSession } from '../account-db.js';
3
3
  import { config } from '../load-config.js';
4
4
  export const TOKEN_EXPIRATION_NEVER = -1;
5
5
  const MS_PER_SECOND = 1000;
6
- /**
7
- * @param {import('express').Request} req
8
- * @param {import('express').Response} res
9
- */
10
6
  export function validateSession(req, res) {
11
7
  let { token } = req.body || {};
12
8
  if (!token) {
@@ -38,11 +34,14 @@ export function validateAuthHeader(req) {
38
34
  const trustedAuthProxies = config.get('trustedAuthProxies') ?? config.get('trustedProxies');
39
35
  // ensure the first hop from our server is trusted
40
36
  const peer = req.socket.remoteAddress;
37
+ if (peer === undefined) {
38
+ console.error(`Header Auth Login attempted but there was no defined peer.`);
39
+ return false;
40
+ }
41
41
  const peerIp = ipaddr.process(peer);
42
42
  const rangeList = {
43
43
  allowed_ips: trustedAuthProxies.map(q => ipaddr.parseCIDR(q)),
44
44
  };
45
- // @ts-ignore : there is an error in the ts definition for the function, but this is valid
46
45
  const matched = ipaddr.subnetMatch(peerIp, rangeList, 'fail');
47
46
  if (matched === 'allowed_ips') {
48
47
  console.info(`Header Auth Login permitted from ${peer}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/sync-server",
3
- "version": "26.1.0-nightly.20251213",
3
+ "version": "26.1.0-nightly.20251214",
4
4
  "license": "MIT",
5
5
  "description": "actual syncing server",
6
6
  "bin": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@actual-app/crdt": "2.1.0",
32
- "@actual-app/web": "26.1.0-nightly.20251213",
32
+ "@actual-app/web": "26.1.0-nightly.20251214",
33
33
  "bcrypt": "^6.0.0",
34
34
  "better-sqlite3": "^12.4.1",
35
35
  "convict": "^6.2.4",