From 0e2d9c7aa387521ea02ea446e44976f4f5c26e18 Mon Sep 17 00:00:00 2001 From: prostgles Date: Thu, 28 Nov 2024 15:15:13 +0200 Subject: [PATCH] fix auth withPassword bug --- lib/Auth/AuthHandler.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- tests/client/package-lock.json | 8 ++++---- tests/client/package.json | 2 +- tests/clientOnlyQueries.spec.ts | 2 ++ tests/server/package-lock.json | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/Auth/AuthHandler.ts b/lib/Auth/AuthHandler.ts index 8b77793e..ea52821d 100644 --- a/lib/Auth/AuthHandler.ts +++ b/lib/Auth/AuthHandler.ts @@ -428,7 +428,7 @@ export class AuthHandler { providers: getProviders.bind(this)(), register: this.opts?.expressConfig?.registrations?.email && { type: this.opts?.expressConfig?.registrations?.email.signupType, url: AUTH_ROUTES_AND_PARAMS.emailSignup }, user: userData?.clientUser, - loginType: this.opts?.expressConfig?.registrations?.email?.signupType, + loginType: this.opts?.expressConfig?.registrations?.email?.signupType ?? "withPassword", pathGuard, }; return { auth, userData }; diff --git a/package-lock.json b/package-lock.json index 26fb4249..7213d042 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prostgles-server", - "version": "4.2.166", + "version": "4.2.167", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prostgles-server", - "version": "4.2.166", + "version": "4.2.167", "license": "MIT", "dependencies": { "@aws-sdk/client-ses": "^3.699.0", diff --git a/package.json b/package.json index 49a56853..ce911274 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prostgles-server", - "version": "4.2.166", + "version": "4.2.167", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/tests/client/package-lock.json b/tests/client/package-lock.json index de6cad45..60a27083 100644 --- a/tests/client/package-lock.json +++ b/tests/client/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@types/node": "^20.9.2", - "prostgles-client": "^4.0.154", + "prostgles-client": "^4.0.158", "prostgles-types": "^4.0.51", "socket.io-client": "^4.7.5" }, @@ -327,9 +327,9 @@ } }, "node_modules/prostgles-client": { - "version": "4.0.154", - "resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.154.tgz", - "integrity": "sha512-fv/Mjl9/bR0y1w0G1BoZ90Vb1mUAJWriPafgVJ7x9HhBoCHPE+2PAE+B+UGNdLngzL0W+bFpYW1SDzLdmrxM/A==", + "version": "4.0.158", + "resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.158.tgz", + "integrity": "sha512-mmyPEkkRLTReeybsz4u0xVrHXvD5OIyeFqeo4ykU6t55n7tG819CHfoGcHibUVLMW/PLCUj0ZlcOrltqYue5Fw==", "license": "MIT", "dependencies": { "prostgles-types": "^4.0.107" diff --git a/tests/client/package.json b/tests/client/package.json index f8ccf650..e52d0bad 100644 --- a/tests/client/package.json +++ b/tests/client/package.json @@ -13,7 +13,7 @@ "license": "ISC", "dependencies": { "@types/node": "^20.9.2", - "prostgles-client": "^4.0.154", + "prostgles-client": "^4.0.158", "prostgles-types": "^4.0.51", "socket.io-client": "^4.7.5" }, diff --git a/tests/clientOnlyQueries.spec.ts b/tests/clientOnlyQueries.spec.ts index 5da1cd1d..e4c3f3e6 100644 --- a/tests/clientOnlyQueries.spec.ts +++ b/tests/clientOnlyQueries.spec.ts @@ -527,6 +527,8 @@ export const clientOnlyQueries = async (db: DBHandlerClient, auth: AuthHandler, /* TODO: SECURITY */ log("auth.user:", auth.user); + + assert.equal(!!auth.login.withPassword, true, "auth.login.withPassword should be defined"); const isUser = !!auth.user; // Public data diff --git a/tests/server/package-lock.json b/tests/server/package-lock.json index 468b5d64..772d5008 100644 --- a/tests/server/package-lock.json +++ b/tests/server/package-lock.json @@ -21,7 +21,7 @@ }, "../..": { "name": "prostgles-server", - "version": "4.2.166", + "version": "4.2.167", "license": "MIT", "dependencies": { "@aws-sdk/client-ses": "^3.699.0",