Skip to content

Commit

Permalink
fix auth withPassword bug
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 28, 2024
1 parent 1ee4870 commit 0e2d9c7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/Auth/AuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions tests/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions tests/clientOnlyQueries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e2d9c7

Please sign in to comment.