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