prostgles-client 4.0.397 → 4.0.399

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthState.d.ts","sourceRoot":"","sources":["../../lib/auth/useAuthState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA2BtF,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa/C,OAAO;iBACP,MAAM;;;CAkNlB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;CA8B7B,CAAC"}
1
+ {"version":3,"file":"useAuthState.d.ts","sourceRoot":"","sources":["../../lib/auth/useAuthState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1E,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA2BtF,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa/C,OAAO;iBACP,MAAM;;;CAoNlB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;CA8B7B,CAAC"}
@@ -92,13 +92,15 @@ const useAuthState = ({ auth }) => {
92
92
  : undefined;
93
93
  const isOnLogin = loginStates.some((v) => v === state);
94
94
  const registerTypeAllowed = "registerWithPassword";
95
+ const shownKeys = (0, prostgles_types_1.getKeys)(show).filter((key) => show[key]);
96
+ const isOnlyShowingUsername = shownKeys[0] === "username" && shownKeys.length === 1;
95
97
  const onAuthCall = async () => {
96
98
  const formData = {
97
99
  username,
98
- password,
100
+ password: isOnlyShowingUsername ? undefined : password,
99
101
  remember_me: false,
100
- totp_token: totpToken,
101
- totp_recovery_code: totpRecoveryCode,
102
+ totp_token: isOnlyShowingUsername ? undefined : totpToken,
103
+ totp_recovery_code: isOnlyShowingUsername ? undefined : totpRecoveryCode,
102
104
  };
103
105
  const errorMap = {
104
106
  "no match": "Invalid credentials",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-client",
3
- "version": "4.0.397",
3
+ "version": "4.0.399",
4
4
  "description": "Reactive client for Postgres",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "pushpublish": "npm version patch --git-tag-version false && git push && npm publish"
29
29
  },
30
30
  "dependencies": {
31
- "prostgles-types": "^4.0.285",
31
+ "prostgles-types": "^4.0.286",
32
32
  "socket.io-client": "^4.8.3"
33
33
  },
34
34
  "devDependencies": {