@andrey4emk/npm-app-back-b24 0.5.5 → 0.5.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrey4emk/npm-app-back-b24",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Bitrix24 OAuth helpers for Node.js projects",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -121,23 +121,22 @@ export class ChatApp {
121
121
 
122
122
  async checkTokenChatApp() {
123
123
  console.log("checkTokenChatApp called");
124
+ console.log("Current accessToken:", this.auth.accessToken);
124
125
  try {
125
126
  const response = await fetch("https://api.chatapp.online/v1/tokens/check", {
126
- method: "POST",
127
+ method: "GET",
127
128
  headers: {
128
129
  Lang: "en",
129
130
  "Content-Type": "application/json",
130
131
  Accept: "application/json",
131
- },
132
- body: JSON.stringify({
133
132
  accessToken: this.auth.accessToken,
134
- }),
133
+ },
135
134
  });
136
135
 
137
136
  const data = await response.json();
138
137
  console.log("Token check response data:", data);
139
138
  if (!data.success) {
140
- await this.refreshTokenChatApp();
139
+ // await this.refreshTokenChatApp();
141
140
  return { error: false, message: "Токен обновлен" };
142
141
  } else {
143
142
  return { error: false, message: "Токен действителен" };