prostgles-client 4.0.151 → 4.0.153

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.
package/lib/Auth.ts CHANGED
@@ -9,14 +9,18 @@ type Args = {
9
9
 
10
10
  type WithProviderLogin = Partial<Record<IdentityProvider, VoidFunction>>;
11
11
 
12
+ type SignupResult =
13
+ | { success: true; }
14
+ | { success: false; error: string; }
15
+
12
16
  type EmailAuth =
13
17
  | {
14
- withPassword?: (params: { username: string; password: string; remember_me?: boolean; totp_token?: string; totp_recovery_code?: string; }) => Promise<any>;
18
+ withPassword?: (params: { username: string; password: string; remember_me?: boolean; totp_token?: string; totp_recovery_code?: string; }) => Promise<SignupResult>;
15
19
  withMagicLink?: undefined;
16
20
  }
17
21
  | {
18
22
  withPassword?: undefined;
19
- withMagicLink?: (params: { username: string; }) => Promise<any>;
23
+ withMagicLink?: (params: { username: string; }) => Promise<SignupResult>;
20
24
  }
21
25
 
22
26
  type LoginSignupOptions = {
@@ -91,7 +95,7 @@ export const setupAuth = ({ authData: authConfig, socket, onReload }: Args): Aut
91
95
 
92
96
  loginSignupOptions.register = register?.type? {
93
97
  [register.type]: (params) => {
94
- POST(register.url, params);
98
+ return POST(register.url, params);
95
99
  }
96
100
  } : undefined;
97
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-client",
3
- "version": "4.0.151",
3
+ "version": "4.0.153",
4
4
  "description": "Reactive client for Postgres",
5
5
  "main": "dist/prostgles-full.js",
6
6
  "types": "dist/prostgles-full.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "..": {
19
19
  "name": "prostgles-client",
20
- "version": "4.0.150",
20
+ "version": "4.0.152",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "prostgles-types": "^4.0.107"