@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.mjs
CHANGED
|
@@ -379,17 +379,18 @@ var Auth = class {
|
|
|
379
379
|
*/
|
|
380
380
|
async signUp(request) {
|
|
381
381
|
try {
|
|
382
|
-
const response = await this.http.post("/api/auth/users", request);
|
|
382
|
+
const response = await this.http.post("/api/auth/users", request, { credentials: "include" });
|
|
383
383
|
if (response.accessToken && response.user && !isHostedAuthEnvironment()) {
|
|
384
384
|
const session = {
|
|
385
385
|
accessToken: response.accessToken,
|
|
386
386
|
user: response.user
|
|
387
387
|
};
|
|
388
|
-
this.tokenManager.saveSession(session);
|
|
389
|
-
this.http.setAuthToken(response.accessToken);
|
|
390
388
|
if (response.csrfToken) {
|
|
389
|
+
this.tokenManager.setMemoryMode();
|
|
391
390
|
setCsrfToken(response.csrfToken);
|
|
392
391
|
}
|
|
392
|
+
this.tokenManager.saveSession(session);
|
|
393
|
+
this.http.setAuthToken(response.accessToken);
|
|
393
394
|
}
|
|
394
395
|
return {
|
|
395
396
|
data: response,
|
|
@@ -414,17 +415,18 @@ var Auth = class {
|
|
|
414
415
|
*/
|
|
415
416
|
async signInWithPassword(request) {
|
|
416
417
|
try {
|
|
417
|
-
const response = await this.http.post("/api/auth/sessions", request);
|
|
418
|
+
const response = await this.http.post("/api/auth/sessions", request, { credentials: "include" });
|
|
418
419
|
if (!isHostedAuthEnvironment()) {
|
|
419
420
|
const session = {
|
|
420
421
|
accessToken: response.accessToken,
|
|
421
422
|
user: response.user
|
|
422
423
|
};
|
|
423
|
-
this.tokenManager.saveSession(session);
|
|
424
|
-
this.http.setAuthToken(response.accessToken);
|
|
425
424
|
if (response.csrfToken) {
|
|
425
|
+
this.tokenManager.setMemoryMode();
|
|
426
426
|
setCsrfToken(response.csrfToken);
|
|
427
427
|
}
|
|
428
|
+
this.tokenManager.saveSession(session);
|
|
429
|
+
this.http.setAuthToken(response.accessToken);
|
|
428
430
|
}
|
|
429
431
|
return {
|
|
430
432
|
data: response,
|
|
@@ -855,18 +857,20 @@ var Auth = class {
|
|
|
855
857
|
try {
|
|
856
858
|
const response = await this.http.post(
|
|
857
859
|
"/api/auth/email/verify",
|
|
858
|
-
request
|
|
860
|
+
request,
|
|
861
|
+
{ credentials: "include" }
|
|
859
862
|
);
|
|
860
863
|
if (!isHostedAuthEnvironment()) {
|
|
861
864
|
const session = {
|
|
862
865
|
accessToken: response.accessToken,
|
|
863
866
|
user: response.user
|
|
864
867
|
};
|
|
865
|
-
this.tokenManager.saveSession(session);
|
|
866
|
-
this.http.setAuthToken(response.accessToken);
|
|
867
868
|
if (response.csrfToken) {
|
|
869
|
+
this.tokenManager.setMemoryMode();
|
|
868
870
|
setCsrfToken(response.csrfToken);
|
|
869
871
|
}
|
|
872
|
+
this.tokenManager.saveSession(session);
|
|
873
|
+
this.http.setAuthToken(response.accessToken);
|
|
870
874
|
}
|
|
871
875
|
return {
|
|
872
876
|
data: response,
|