@maxzima/wa-communicator 1.0.28 → 1.0.29
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.
|
@@ -47,11 +47,16 @@ export class Communicator {
|
|
|
47
47
|
meta,
|
|
48
48
|
mobile: data.phoneNumber,
|
|
49
49
|
});
|
|
50
|
+
const queryParams = {};
|
|
51
|
+
if (data.outOfBandAllowed) {
|
|
52
|
+
queryParams['out_of_band_allowed'] = true;
|
|
53
|
+
}
|
|
50
54
|
return yield this.send({
|
|
51
55
|
method: 'POST',
|
|
52
56
|
url: `${this.props.clientAuthApiBaseUrl}${"sign-in"}`,
|
|
53
57
|
body,
|
|
54
58
|
headers,
|
|
59
|
+
queryParams,
|
|
55
60
|
});
|
|
56
61
|
});
|
|
57
62
|
}
|
|
@@ -143,7 +148,6 @@ export class Communicator {
|
|
|
143
148
|
}
|
|
144
149
|
closeSSEAuth() {
|
|
145
150
|
if (this.sseAuth) {
|
|
146
|
-
console.log(this.sseAuth.readyState);
|
|
147
151
|
this.sseAuth.close();
|
|
148
152
|
this.sseAuth = null;
|
|
149
153
|
}
|
package/package.json
CHANGED
|
@@ -47,11 +47,18 @@ export class Communicator {
|
|
|
47
47
|
mobile: data.phoneNumber,
|
|
48
48
|
} as TSignInStartRequestBody);
|
|
49
49
|
|
|
50
|
+
const queryParams = {}
|
|
51
|
+
if (data.outOfBandAllowed) {
|
|
52
|
+
// TODO: temporary
|
|
53
|
+
queryParams['out_of_band_allowed'] = true;
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
return await this.send({
|
|
51
57
|
method: 'POST',
|
|
52
58
|
url: `${this.props.clientAuthApiBaseUrl}${CommunicatorAuthAPIEndpointEnum.SIGN_IN}`,
|
|
53
59
|
body,
|
|
54
60
|
headers,
|
|
61
|
+
queryParams,
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
64
|
|
|
@@ -147,8 +154,7 @@ export class Communicator {
|
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
public closeSSEAuth() {
|
|
150
|
-
if (this.sseAuth) {
|
|
151
|
-
console.log(this.sseAuth.readyState);
|
|
157
|
+
if (this.sseAuth) { // && this.sseAuth.readyState === EventSource.OPEN
|
|
152
158
|
this.sseAuth.close();
|
|
153
159
|
this.sseAuth = null;
|
|
154
160
|
}
|