From 7723781eca24dffccfeea99326c076cdc1643129 Mon Sep 17 00:00:00 2001 From: Rajat Khanduri <38693805+wthrajat@users.noreply.github.com> Date: Tue, 24 Mar 2026 23:41:02 +0530 Subject: [PATCH] chore: fix two factor authentication (#674) * chore: fix two factor authentication * chore: add thunderhub homepage * chore: update lib version * chore: revert lib version bump --- .gitignore | 1 + package-lock.json | 132 +++++++++++-------- package.json | 85 ++++++------ src/server/modules/api/auth/auth.resolver.ts | 18 +-- 4 files changed, 131 insertions(+), 105 deletions(-) diff --git a/.gitignore b/.gitignore index 8b21f8cc..c5b5d27c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /dist /node_modules src/client/dist +src/client/.next/ # Logs logs diff --git a/package-lock.json b/package-lock.json index 5ced20c2..7a0ecb11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "lodash": "^4.17.23", "lucide-react": "^0.577.0", "nest-winston": "^1.10.2", - "otplib": "^13.3.0", + "otplib": "^13.4.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", "qrcode.react": "^4.2.0", @@ -378,6 +378,7 @@ "resolved": "https://registry.npmjs.org/@apollo/server/-/server-5.4.0.tgz", "integrity": "sha512-E0/2C5Rqp7bWCjaDh4NzYuEPDZ+dltTf2c0FI6GCKJA6GBetVferX3h1//1rS4+NxD36wrJsGGJK+xyT/M3ysg==", "license": "MIT", + "peer": true, "dependencies": { "@apollo/cache-control-types": "^1.0.3", "@apollo/server-gateway-interface": "^2.0.0", @@ -797,6 +798,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -1585,6 +1587,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -4875,6 +4878,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.16.tgz", "integrity": "sha512-JSIeW+USuMJkkcNbiOdcPkVCeI3TSnXstIVEPpp3HiaKnPRuSbUUKm9TY9o/XpIcPHWUOQItAtC5BiAwFdVITQ==", "license": "MIT", + "peer": true, "dependencies": { "file-type": "21.3.0", "iterare": "1.2.1", @@ -4940,6 +4944,7 @@ "integrity": "sha512-tXWXyCiqWthelJjrE0KLFjf0O98VEt+WPVx5CrqCf+059kIxJ8y1Vw7Cy7N4fwQafWNrmFL2AfN87DDMbVAY0w==", "hasInstallScript": true, "license": "MIT", + "peer": true, "dependencies": { "@nuxt/opencollective": "0.4.1", "fast-safe-stringify": "2.1.1", @@ -4986,6 +4991,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/graphql/-/graphql-13.2.4.tgz", "integrity": "sha512-UXtsY4o1gsSG8tlY2HI3NuWyW15eOSG7IX1nG92T5/VtsEsafhtYOnc0H9Z7zFzUn0tPBCcRte1NgVNEIgAAdw==", "license": "MIT", + "peer": true, "dependencies": { "@graphql-tools/merge": "9.1.7", "@graphql-tools/schema": "10.0.31", @@ -5288,6 +5294,7 @@ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", "license": "MIT", + "peer": true, "engines": { "node": "^14.21.3 || >=16" }, @@ -5399,28 +5406,28 @@ "license": "MIT" }, "node_modules/@otplib/core": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/core/-/core-13.3.0.tgz", - "integrity": "sha512-pnQDOuCmFVeF/XnboJq9TOJgLoo2idNPJKMymOF8vGqJJ+ReKRYM9bUGjNPRWC0tHjMwu1TXbnzyBp494JgRag==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/core/-/core-13.4.0.tgz", + "integrity": "sha512-JqOGcvZQi2wIkEQo8f3/iAjstavpXy6gouIDMHygjNuH6Q0FjbHOiXMdcE94RwfgDNMABhzwUmvaPsxvgm9NYw==", "license": "MIT" }, "node_modules/@otplib/hotp": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/hotp/-/hotp-13.3.0.tgz", - "integrity": "sha512-XJMZGz2bg4QJwK7ulvl1GUI2VMn/flaIk/E/BTKAejHsX2kUtPF1bRhlZ2+elq8uU5Fs9Z9FHcQK2CPZNQbbUQ==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/hotp/-/hotp-13.4.0.tgz", + "integrity": "sha512-MJjE0x06mn2ptymz5qZmQveb+vWFuaIftqE0b5/TZZqUOK7l97cV8lRTmid5BpAQMwJDNLW6RnYxGeCRiNdekw==", "license": "MIT", "dependencies": { - "@otplib/core": "13.3.0", - "@otplib/uri": "13.3.0" + "@otplib/core": "13.4.0", + "@otplib/uri": "13.4.0" } }, "node_modules/@otplib/plugin-base32-scure": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/plugin-base32-scure/-/plugin-base32-scure-13.3.0.tgz", - "integrity": "sha512-/jYbL5S6GB0Ie3XGEWtLIr9s5ZICl/BfmNL7+8/W7usZaUU4GiyLd2S+JGsNCslPyqNekSudD864nDAvRI0s8w==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/plugin-base32-scure/-/plugin-base32-scure-13.4.0.tgz", + "integrity": "sha512-/t9YWJmMbB8bF5z8mXrBZc2FXBe8B/3hG5FhWr9K8cFwFhyxScbPysmZe8s1UTzSA6N+s8Uv8aIfCtVXPNjJWw==", "license": "MIT", "dependencies": { - "@otplib/core": "13.3.0", + "@otplib/core": "13.4.0", "@scure/base": "^2.0.0" } }, @@ -5434,13 +5441,13 @@ } }, "node_modules/@otplib/plugin-crypto-noble": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/plugin-crypto-noble/-/plugin-crypto-noble-13.3.0.tgz", - "integrity": "sha512-wmV+jBVncepgwv99G7Plrdzd0tHfbpXk2U+OD7MO7DzpDqOYEgOPi+IIneksJSTL8QvWdfi+uQEuhnER4fKouA==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/plugin-crypto-noble/-/plugin-crypto-noble-13.4.0.tgz", + "integrity": "sha512-KrvE4m7Zv+TT1944HzgqFJWJpKb6AyoxDbvhPStmBqdMlv5Gekb80d66cuFRL08kkPgJ5gXUSb5SFpYeB+bACg==", "license": "MIT", "dependencies": { "@noble/hashes": "^2.0.1", - "@otplib/core": "13.3.0" + "@otplib/core": "13.4.0" } }, "node_modules/@otplib/plugin-crypto-noble/node_modules/@noble/hashes": { @@ -5456,23 +5463,23 @@ } }, "node_modules/@otplib/totp": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/totp/-/totp-13.3.0.tgz", - "integrity": "sha512-XfjGNoN8d9S3Ove2j7AwkVV7+QDFsV7Lm7YwSiezNaHffkWtJ60aJYpmf+01dARdPST71U2ptueMsRJso4sq4A==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/totp/-/totp-13.4.0.tgz", + "integrity": "sha512-dK+vl0f0ekzf6mCENRI9AKS2NJUC7OjI3+X8e7QSnhQ2WM7I+i4PGpb3QxKi5hxjTtwVuoZwXR2CFtXdcRtNdQ==", "license": "MIT", "dependencies": { - "@otplib/core": "13.3.0", - "@otplib/hotp": "13.3.0", - "@otplib/uri": "13.3.0" + "@otplib/core": "13.4.0", + "@otplib/hotp": "13.4.0", + "@otplib/uri": "13.4.0" } }, "node_modules/@otplib/uri": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@otplib/uri/-/uri-13.3.0.tgz", - "integrity": "sha512-3oh6nBXy+cm3UX9cxEAGZiDrfxHU2gfelYFV+XNCx+8dq39VaQVymwlU2yjPZiMAi/3agaUeEftf2RwM5F+Cyg==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/@otplib/uri/-/uri-13.4.0.tgz", + "integrity": "sha512-x1ozBa5bPbdZCrrTL/HK21qchiK7jYElTu+0ft22abeEhiLYgH1+SIULvOcVk3CK8YwF4kdcidvkq4ciejucJA==", "license": "MIT", "dependencies": { - "@otplib/core": "13.3.0" + "@otplib/core": "13.4.0" } }, "node_modules/@pkgjs/parseargs": { @@ -8192,6 +8199,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.18.0" } @@ -8207,7 +8215,6 @@ "resolved": "https://registry.npmjs.org/@types/randombytes/-/randombytes-2.0.3.tgz", "integrity": "sha512-+NRgihTfuURllWCiIAhm1wsJqzsocnqXM77V/CalsdJIYSRGEHMnritxh+6EsBklshC+clo1KgnN14qgSGeQdw==", "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*" } @@ -8218,6 +8225,7 @@ "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -8228,6 +8236,7 @@ "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^19.2.0" } @@ -8355,6 +8364,7 @@ "integrity": "sha512-XZzOmihLIr8AD1b9hL9ccNMzEMWt/dE2u7NyTY9jJG6YNiNthaD5XtUHVF2uCXZ15ng+z2hT3MVuxnUYhq6k1g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.57.0", "@typescript-eslint/types": "8.57.0", @@ -9200,6 +9210,7 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "devOptional": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -9259,6 +9270,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -9688,7 +9700,6 @@ "resolved": "https://registry.npmjs.org/bip174-liquid/-/bip174-liquid-1.0.3.tgz", "integrity": "sha512-e69sC0Cq2tBJuhG2+wieXv40DN13YBR/wbIjZp4Mqwpar5vQm8Ldqijdd6N33XG7LtfvQi/zKm5fSzdPY/9mgw==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -9767,7 +9778,6 @@ "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", "license": "MIT", - "peer": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -9800,7 +9810,6 @@ "resolved": "https://registry.npmjs.org/bitset/-/bitset-5.2.3.tgz", "integrity": "sha512-uZ7++Z60MC9cZ+7YzQ1v9yPDydcjhmcMjGx2yoGTjjSXBoVMmTr2LCRbkpI19S9P/C75hhP7Bsakj+gVzVUDbQ==", "license": "MIT", - "peer": true, "engines": { "node": "*" }, @@ -9825,7 +9834,6 @@ "resolved": "https://registry.npmjs.org/blech32/-/blech32-1.1.2.tgz", "integrity": "sha512-C5qxzoF9KyX88X8Zz18cZ6BOeL0n5/Eg/cDot1frntkArRMwg1djNim5wA6QFWwu0lJ1LN8iiRMN4Lp2kZzdfA==", "license": "MIT", - "peer": true, "dependencies": { "long": "^4.0.0" }, @@ -9950,6 +9958,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -11056,7 +11065,6 @@ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "license": "MIT", - "peer": true, "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -11162,7 +11170,8 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/d3-array": { "version": "3.2.4", @@ -11937,6 +11946,7 @@ "integrity": "sha512-COV33RzXZkqhG9P2rZCFl9ZmJ7WL+gQSCRzE7RhkbclbQPtLAWReL7ysA0Sh4c8Im2U9ynybdR56PV0XcKvqaQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", @@ -11993,6 +12003,7 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -12340,6 +12351,7 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -13423,6 +13435,7 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.13.1.tgz", "integrity": "sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -13728,6 +13741,7 @@ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.7.tgz", "integrity": "sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==", "license": "MIT", + "peer": true, "engines": { "node": ">=16.9.0" } @@ -14473,6 +14487,7 @@ "integrity": "sha512-AkXIIFcaazymvey2i/+F94XRnM6TsVLZDhBMLsd1Sf/W0wzsvvpjeyUrCZD6HGG4SDYPgDJDBKeiJTBb10WzMg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/core": "30.3.0", "@jest/types": "30.3.0", @@ -16109,7 +16124,6 @@ "resolved": "https://registry.npmjs.org/liquidjs-lib/-/liquidjs-lib-6.0.2-liquid.37.tgz", "integrity": "sha512-AOPwqg9wtLMNxfqOf8afC+bYYrs3VBsTq/Mq/iOe0F2X3CcbgiLeSAcvOY34jbnUre6U+zmuXKP9bWmxnOG08A==", "license": "MIT", - "peer": true, "dependencies": { "@types/randombytes": "^2.0.0", "bech32": "^2.0.0", @@ -16134,7 +16148,6 @@ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", "license": "MIT", - "peer": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -16144,7 +16157,6 @@ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "license": "MIT", - "peer": true, "dependencies": { "base-x": "^3.0.2" } @@ -16154,7 +16166,6 @@ "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", "license": "MIT", - "peer": true, "dependencies": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -16166,7 +16177,6 @@ "resolved": "https://registry.npmjs.org/ecpair/-/ecpair-2.1.0.tgz", "integrity": "sha512-cL/mh3MtJutFOvFc27GPZE2pWL3a3k4YvzUWEOvilnfZVlH3Jwgx/7d6tlD7/75tNk8TG2m+7Kgtz0SI1tWcqw==", "license": "MIT", - "peer": true, "dependencies": { "randombytes": "^2.1.0", "typeforce": "^1.18.0", @@ -16181,7 +16191,6 @@ "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", "license": "MIT", - "peer": true, "dependencies": { "bs58check": "<3.0.0" } @@ -17651,17 +17660,17 @@ } }, "node_modules/otplib": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/otplib/-/otplib-13.3.0.tgz", - "integrity": "sha512-VYMKyyDG8yt2q+z58sz54/EIyTh7+tyMrjeemR44iVh5+dkKtIs57irTqxjH+IkAL1uMmG1JIFhG5CxTpqdU5g==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/otplib/-/otplib-13.4.0.tgz", + "integrity": "sha512-RUcYcRMCgRWhUE/XabRppXpUwCwaWBNHe5iPXhdvP8wwDGpGpsIf/kxX/ec3zFsOaM1Oq8lEhUqDwk6W7DHkwg==", "license": "MIT", "dependencies": { - "@otplib/core": "13.3.0", - "@otplib/hotp": "13.3.0", - "@otplib/plugin-base32-scure": "13.3.0", - "@otplib/plugin-crypto-noble": "13.3.0", - "@otplib/totp": "13.3.0", - "@otplib/uri": "13.3.0" + "@otplib/core": "13.4.0", + "@otplib/hotp": "13.4.0", + "@otplib/plugin-base32-scure": "13.4.0", + "@otplib/plugin-crypto-noble": "13.4.0", + "@otplib/totp": "13.4.0", + "@otplib/uri": "13.4.0" } }, "node_modules/outvariant": { @@ -17809,6 +17818,7 @@ "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz", "integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==", "license": "MIT", + "peer": true, "dependencies": { "passport-strategy": "1.x.x", "pause": "0.0.1", @@ -18156,6 +18166,7 @@ "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -18501,7 +18512,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "peer": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -18534,6 +18544,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -18546,6 +18557,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -18965,7 +18977,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/remedial": { "version": "1.0.8", @@ -19310,6 +19323,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -19379,6 +19393,7 @@ "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -20091,7 +20106,6 @@ "resolved": "https://registry.npmjs.org/slip77/-/slip77-0.2.0.tgz", "integrity": "sha512-LQaxb1Hef10kU36qvk71tlSt5BWph7GM0j+t2n5zs169X4QfnNbb6xqKZ38X3ETzGmCQaVdBwr925HDagHra/Q==", "license": "MIT", - "peer": true, "dependencies": { "@types/node": "^13.9.1", "create-hmac": "^1.1.7", @@ -20105,8 +20119,7 @@ "version": "13.13.52", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/smart-buffer": { "version": "4.2.0", @@ -20739,6 +20752,7 @@ "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.11.0.tgz", "integrity": "sha512-8D4C6DIH5tGiAIpp5I0wD/xRlNiZAPGHygzCe7VzyzUoxHtawzjNAY9SUTXU05/EY2NMY9/9GF0ycizkXr1CWQ==", "deprecated": "The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md", + "peer": true, "dependencies": { "backo2": "^1.0.2", "eventemitter3": "^3.1.0", @@ -21132,6 +21146,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -21376,6 +21391,7 @@ "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz", "integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==", "license": "MIT", + "peer": true, "dependencies": { "@ts-morph/common": "~0.27.0", "code-block-writer": "^13.0.3" @@ -21387,6 +21403,7 @@ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -21554,6 +21571,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -21934,6 +21952,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -22025,6 +22044,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -22065,6 +22085,7 @@ "integrity": "sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.8", @@ -22284,6 +22305,7 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-3.19.0.tgz", "integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==", "license": "MIT", + "peer": true, "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.8", @@ -22413,6 +22435,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -22587,6 +22610,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 68b9bacc..9c3410f0 100644 --- a/package.json +++ b/package.json @@ -1,38 +1,63 @@ { "name": "thunderhub", "version": "0.15.4", - "description": "Lightning Node Manager", + "description": "Lightning Node Manager - Monitor and manage your node from any browser and any device.", + "homepage": "https://thunderhub.io", "license": "MIT", "scripts": { "prebuild": "rimraf dist && rimraf src/client/dist", "build": "npm run build:nest && npm run build:client", - "build:nest": "nest build", - "build:client": "cd src/client && npx vite build", "build:all": "sh ./scripts/buildMultiArchImage.sh", "build:all:test": "sh ./scripts/buildMultiArchImage.sh --test", + "build:client": "cd src/client && npx vite build", + "build:image": "docker build --pull --rm -f Dockerfile -t thunderhub:testing '.'", + "build:image:base": "docker build --pull --rm -f Dockerfile --build-arg BASE_PATH=/thub -t thunderhub:testing .", + "build:nest": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", - "start": "cross-env NODE_ENV=production nest start", - "start:dev": "concurrently \"nest start --watch\" \"cd src/client && npx vite\"", - "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", - "start:prod:env": "NODE_ENV=production node dist/main", - "release": "standard-version", - "release:test": "standard-version --dry-run", - "release:minor": "standard-version --release-as minor", + "generate": "graphql-codegen --config codegen.yml", "lint": "eslint \"{src,apps,libs,test}/**/*.{ts,tsx}\" --fix", "lint:check": "eslint \"{src,apps,libs,test}/**/*.{ts,tsx}\"", "lint-staged": "lint-staged", - "generate": "graphql-codegen --config codegen.yml", + "prepare": "husky", + "release": "standard-version", + "release:minor": "standard-version --release-as minor", + "release:test": "standard-version --dry-run", + "start": "cross-env NODE_ENV=production nest start", + "start:debug": "nest start --debug --watch", + "start:dev": "concurrently \"nest start --watch\" \"cd src/client && npx vite\"", + "start:prod": "node dist/main", + "start:prod:env": "NODE_ENV=production node dist/main", "test": "jest --passWithNoTests", - "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", - "upgrade-latest": "npx npm-check -u", + "test:watch": "jest --watch", "update": "sh ./scripts/updateToLatest.sh", - "build:image": "docker build --pull --rm -f Dockerfile -t thunderhub:testing '.'", - "build:image:base": "docker build --pull --rm -f Dockerfile --build-arg BASE_PATH=/thub -t thunderhub:testing .", - "prepare": "husky" + "upgrade-latest": "npx npm-check -u" + }, + "lint-staged": { + "*.+(ts|tsx)": [ + "prettier --write", + "jest --bail --findRelatedTests --passWithNoTests", + "eslint --fix" + ] + }, + "jest": { + "collectCoverageFrom": [ + "**/*.(t|j)s" + ], + "coverageDirectory": "../coverage", + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testEnvironment": "node", + "testRegex": ".*\\.spec\\.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } }, "dependencies": { "@apollo/client": "^3.8.8", @@ -84,7 +109,7 @@ "lodash": "^4.17.23", "lucide-react": "^0.577.0", "nest-winston": "^1.10.2", - "otplib": "^13.3.0", + "otplib": "^13.4.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", "qrcode.react": "^4.2.0", @@ -152,30 +177,6 @@ "typescript": "^5.9.3", "vite": "^7.3.1" }, - "jest": { - "moduleFileExtensions": [ - "js", - "json", - "ts" - ], - "rootDir": "src", - "testRegex": ".*\\.spec\\.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" - }, - "collectCoverageFrom": [ - "**/*.(t|j)s" - ], - "coverageDirectory": "../coverage", - "testEnvironment": "node" - }, - "lint-staged": { - "*.+(ts|tsx)": [ - "prettier --write", - "jest --bail --findRelatedTests --passWithNoTests", - "eslint --fix" - ] - }, "standard-version": { "skip": { "commit": true, diff --git a/src/server/modules/api/auth/auth.resolver.ts b/src/server/modules/api/auth/auth.resolver.ts index e3e85608..8e237d8e 100644 --- a/src/server/modules/api/auth/auth.resolver.ts +++ b/src/server/modules/api/auth/auth.resolver.ts @@ -79,10 +79,10 @@ export class AuthResolver { } try { - const isValid = verifySync({ token, secret, epochTolerance: 30 }); + const { valid } = verifySync({ token, secret, epochTolerance: 30 }); - if (!isValid) { - throw new Error(); + if (!valid) { + throw new Error('Invalid token'); } } catch (error) { this.logger.error('Error validating token', { error }); @@ -90,7 +90,7 @@ export class AuthResolver { } const accountConfigPath = this.configService.get('accountConfigPath'); - await this.filesService.updateTwofaSecret( + this.filesService.updateTwofaSecret( accountConfigPath, account.index, secret @@ -117,14 +117,14 @@ export class AuthResolver { } try { - const isValid = verifySync({ + const { valid } = verifySync({ token, secret: account.twofaSecret, epochTolerance: 30, }); - if (!isValid) { - throw new Error(); + if (!valid) { + throw new Error('Invalid token'); } } catch (error) { this.logger.error('Error validating token', { error }); @@ -276,12 +276,12 @@ export class AuthResolver { } try { - const isValid = verifySync({ + const { valid } = verifySync({ token, secret: account.twofaSecret, epochTolerance: 30, }); - if (!isValid) { + if (!valid) { throw new Error('token not valid'); } } catch (err) {