@bibike/erp-sdk 1.1.1 → 1.1.2
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/dist/index.js +11 -6
- package/dist/index.mjs +11 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -361,12 +361,14 @@ var BibikeClient = class {
|
|
|
361
361
|
methods: rawResponse.methods
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
const token = rawResponse.data?.token || rawResponse.token;
|
|
365
|
+
const user = rawResponse.data?.user || rawResponse.user;
|
|
366
|
+
if (token) {
|
|
367
|
+
this.token = token;
|
|
366
368
|
}
|
|
367
369
|
return {
|
|
368
370
|
success: true,
|
|
369
|
-
data:
|
|
371
|
+
data: { token, user }
|
|
370
372
|
};
|
|
371
373
|
}
|
|
372
374
|
/**
|
|
@@ -374,12 +376,15 @@ var BibikeClient = class {
|
|
|
374
376
|
*/
|
|
375
377
|
async verify2FA(input) {
|
|
376
378
|
const response = await this.request("auth", "verify_2fa", "POST", input);
|
|
377
|
-
|
|
378
|
-
|
|
379
|
+
const rawResponse = response;
|
|
380
|
+
const token = rawResponse.data?.token || rawResponse.token;
|
|
381
|
+
const user = rawResponse.data?.user || rawResponse.user;
|
|
382
|
+
if (token) {
|
|
383
|
+
this.token = token;
|
|
379
384
|
}
|
|
380
385
|
return {
|
|
381
386
|
success: true,
|
|
382
|
-
data:
|
|
387
|
+
data: { token, user }
|
|
383
388
|
};
|
|
384
389
|
}
|
|
385
390
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -334,12 +334,14 @@ var BibikeClient = class {
|
|
|
334
334
|
methods: rawResponse.methods
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
const token = rawResponse.data?.token || rawResponse.token;
|
|
338
|
+
const user = rawResponse.data?.user || rawResponse.user;
|
|
339
|
+
if (token) {
|
|
340
|
+
this.token = token;
|
|
339
341
|
}
|
|
340
342
|
return {
|
|
341
343
|
success: true,
|
|
342
|
-
data:
|
|
344
|
+
data: { token, user }
|
|
343
345
|
};
|
|
344
346
|
}
|
|
345
347
|
/**
|
|
@@ -347,12 +349,15 @@ var BibikeClient = class {
|
|
|
347
349
|
*/
|
|
348
350
|
async verify2FA(input) {
|
|
349
351
|
const response = await this.request("auth", "verify_2fa", "POST", input);
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
const rawResponse = response;
|
|
353
|
+
const token = rawResponse.data?.token || rawResponse.token;
|
|
354
|
+
const user = rawResponse.data?.user || rawResponse.user;
|
|
355
|
+
if (token) {
|
|
356
|
+
this.token = token;
|
|
352
357
|
}
|
|
353
358
|
return {
|
|
354
359
|
success: true,
|
|
355
|
-
data:
|
|
360
|
+
data: { token, user }
|
|
356
361
|
};
|
|
357
362
|
}
|
|
358
363
|
/**
|