@insforge/sdk 1.0.7 → 1.0.8
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 +13 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -418,17 +418,18 @@ var Auth = class {
|
|
|
418
418
|
*/
|
|
419
419
|
async signUp(request) {
|
|
420
420
|
try {
|
|
421
|
-
const response = await this.http.post("/api/auth/users", request);
|
|
421
|
+
const response = await this.http.post("/api/auth/users", request, { credentials: "include" });
|
|
422
422
|
if (response.accessToken && response.user && !isHostedAuthEnvironment()) {
|
|
423
423
|
const session = {
|
|
424
424
|
accessToken: response.accessToken,
|
|
425
425
|
user: response.user
|
|
426
426
|
};
|
|
427
|
-
this.tokenManager.saveSession(session);
|
|
428
|
-
this.http.setAuthToken(response.accessToken);
|
|
429
427
|
if (response.csrfToken) {
|
|
428
|
+
this.tokenManager.setMemoryMode();
|
|
430
429
|
setCsrfToken(response.csrfToken);
|
|
431
430
|
}
|
|
431
|
+
this.tokenManager.saveSession(session);
|
|
432
|
+
this.http.setAuthToken(response.accessToken);
|
|
432
433
|
}
|
|
433
434
|
return {
|
|
434
435
|
data: response,
|
|
@@ -453,17 +454,18 @@ var Auth = class {
|
|
|
453
454
|
*/
|
|
454
455
|
async signInWithPassword(request) {
|
|
455
456
|
try {
|
|
456
|
-
const response = await this.http.post("/api/auth/sessions", request);
|
|
457
|
+
const response = await this.http.post("/api/auth/sessions", request, { credentials: "include" });
|
|
457
458
|
if (!isHostedAuthEnvironment()) {
|
|
458
459
|
const session = {
|
|
459
460
|
accessToken: response.accessToken,
|
|
460
461
|
user: response.user
|
|
461
462
|
};
|
|
462
|
-
this.tokenManager.saveSession(session);
|
|
463
|
-
this.http.setAuthToken(response.accessToken);
|
|
464
463
|
if (response.csrfToken) {
|
|
464
|
+
this.tokenManager.setMemoryMode();
|
|
465
465
|
setCsrfToken(response.csrfToken);
|
|
466
466
|
}
|
|
467
|
+
this.tokenManager.saveSession(session);
|
|
468
|
+
this.http.setAuthToken(response.accessToken);
|
|
467
469
|
}
|
|
468
470
|
return {
|
|
469
471
|
data: response,
|
|
@@ -894,18 +896,20 @@ var Auth = class {
|
|
|
894
896
|
try {
|
|
895
897
|
const response = await this.http.post(
|
|
896
898
|
"/api/auth/email/verify",
|
|
897
|
-
request
|
|
899
|
+
request,
|
|
900
|
+
{ credentials: "include" }
|
|
898
901
|
);
|
|
899
902
|
if (!isHostedAuthEnvironment()) {
|
|
900
903
|
const session = {
|
|
901
904
|
accessToken: response.accessToken,
|
|
902
905
|
user: response.user
|
|
903
906
|
};
|
|
904
|
-
this.tokenManager.saveSession(session);
|
|
905
|
-
this.http.setAuthToken(response.accessToken);
|
|
906
907
|
if (response.csrfToken) {
|
|
908
|
+
this.tokenManager.setMemoryMode();
|
|
907
909
|
setCsrfToken(response.csrfToken);
|
|
908
910
|
}
|
|
911
|
+
this.tokenManager.saveSession(session);
|
|
912
|
+
this.http.setAuthToken(response.accessToken);
|
|
909
913
|
}
|
|
910
914
|
return {
|
|
911
915
|
data: response,
|