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