@riocrypto/common-server 1.0.1377 → 1.0.1379
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,8 +23,10 @@ declare class ClusterClient {
|
|
|
23
23
|
limit: number;
|
|
24
24
|
used: number;
|
|
25
25
|
}>;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
sendVerificationCode(phoneNumber: string): Promise<{
|
|
27
|
+
hasAuthenticatorEnabled: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
verifyCode(phoneNumber: string, code?: string, authenticatorCode?: string): Promise<void>;
|
|
28
30
|
}
|
|
29
31
|
export declare const buildClusterClient: () => Promise<ClusterClient>;
|
|
30
32
|
export {};
|
|
@@ -194,18 +194,23 @@ class ClusterClient {
|
|
|
194
194
|
return response.data;
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
|
|
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
|
+
verifyCode(phoneNumber, code, authenticatorCode) {
|
|
207
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
-
yield this.axios.post(`${this.baseUrl}/api/auth/verify-code`, {
|
|
209
|
+
yield this.axios.post(`${this.baseUrl}/api/auth/verify-code`, {
|
|
210
|
+
phoneNumber,
|
|
211
|
+
code: code ? code : undefined,
|
|
212
|
+
authenticatorCode: authenticatorCode ? authenticatorCode : undefined,
|
|
213
|
+
}, {
|
|
209
214
|
headers: {
|
|
210
215
|
"x-cluster-api-key": this.clusterApiKey,
|
|
211
216
|
},
|