@riocrypto/common-server 1.0.1376 → 1.0.1378

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.
@@ -23,7 +23,9 @@ declare class ClusterClient {
23
23
  limit: number;
24
24
  used: number;
25
25
  }>;
26
- sendSMSCode(phoneNumber: string): Promise<void>;
26
+ sendVerificationCode(phoneNumber: string): Promise<{
27
+ hasAuthenticatorEnabled: boolean;
28
+ }>;
27
29
  verifySMSCode(phoneNumber: string, code: string): Promise<void>;
28
30
  }
29
31
  export declare const buildClusterClient: () => Promise<ClusterClient>;
@@ -194,13 +194,14 @@ class ClusterClient {
194
194
  return response.data;
195
195
  });
196
196
  }
197
- sendSMSCode(phoneNumber) {
197
+ sendVerificationCode(phoneNumber) {
198
198
  return __awaiter(this, void 0, void 0, function* () {
199
- yield this.axios.post(`${this.baseUrl}/api/auth/send-code`, { phoneNumber }, {
199
+ const response = yield this.axios.post(`${this.baseUrl}/api/auth/send-code`, { phoneNumber }, {
200
200
  headers: {
201
201
  "x-cluster-api-key": this.clusterApiKey,
202
202
  },
203
203
  });
204
+ return response.data;
204
205
  });
205
206
  }
206
207
  verifySMSCode(phoneNumber, code) {
@@ -79,7 +79,9 @@ const buildAuth = (mongoose) => {
79
79
  delete ret.password;
80
80
  delete ret.securityAnswer;
81
81
  delete ret.previousPasswords;
82
- delete ret.authenticator.secret;
82
+ if (ret.authenticator && ret.authenticator.secret) {
83
+ delete ret.authenticator.secret;
84
+ }
83
85
  for (let apiKey of ret.apiKeys) {
84
86
  delete apiKey.value;
85
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1376",
3
+ "version": "1.0.1378",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",