@andrey4emk/npm-app-back-b24 0.5.4 → 0.5.6
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/package.json +1 -1
- package/sendMessage/chatApp.js +5 -5
package/package.json
CHANGED
package/sendMessage/chatApp.js
CHANGED
|
@@ -123,18 +123,17 @@ export class ChatApp {
|
|
|
123
123
|
console.log("checkTokenChatApp called");
|
|
124
124
|
try {
|
|
125
125
|
const response = await fetch("https://api.chatapp.online/v1/tokens/check", {
|
|
126
|
-
method: "
|
|
126
|
+
method: "GET",
|
|
127
127
|
headers: {
|
|
128
128
|
Lang: "en",
|
|
129
129
|
"Content-Type": "application/json",
|
|
130
130
|
Accept: "application/json",
|
|
131
|
-
},
|
|
132
|
-
body: JSON.stringify({
|
|
133
131
|
accessToken: this.auth.accessToken,
|
|
134
|
-
}
|
|
132
|
+
},
|
|
135
133
|
});
|
|
136
134
|
|
|
137
135
|
const data = await response.json();
|
|
136
|
+
console.log("Token check response data:", data);
|
|
138
137
|
if (!data.success) {
|
|
139
138
|
await this.refreshTokenChatApp();
|
|
140
139
|
return { error: false, message: "Токен обновлен" };
|
|
@@ -164,6 +163,7 @@ export class ChatApp {
|
|
|
164
163
|
});
|
|
165
164
|
|
|
166
165
|
const data = await response.json();
|
|
166
|
+
console.log("Token make response data:", data);
|
|
167
167
|
if (!data.success) {
|
|
168
168
|
return { error: true, message: "Не удалось получить токен ChatApp", data: data };
|
|
169
169
|
} else {
|
|
@@ -194,7 +194,7 @@ export class ChatApp {
|
|
|
194
194
|
}),
|
|
195
195
|
});
|
|
196
196
|
const data = await response.json();
|
|
197
|
-
|
|
197
|
+
console.log("Token refresh response data:", data);
|
|
198
198
|
if (!data.success) {
|
|
199
199
|
let resMakeToken = await this.makeTokenChatApp();
|
|
200
200
|
|