@intellegens/cornerstone-client 0.0.9999-alpha-5 → 0.0.9999-alpha-6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellegens/cornerstone-client",
3
- "version": "0.0.9999-alpha-5",
3
+ "version": "0.0.9999-alpha-6",
4
4
  "private": false,
5
5
  "publishable": true,
6
6
  "main": "./index.js",
@@ -37,7 +37,14 @@ export class AuthService {
37
37
  this.user = undefined;
38
38
  return fail(await res.json());
39
39
  }
40
- return (await res.json());
40
+ const response = (await res.json());
41
+ if (response.ok) {
42
+ this.user = response.result.user;
43
+ }
44
+ else {
45
+ this.user = undefined;
46
+ }
47
+ return response;
41
48
  }
42
49
  catch (err) {
43
50
  console.error(err);
@@ -77,7 +84,7 @@ export class AuthService {
77
84
  }
78
85
  return ok({
79
86
  result: whoamIRes.result.user,
80
- metadata: whoamIRes.metadata
87
+ metadata: whoamIRes.metadata,
81
88
  });
82
89
  }
83
90
  catch (err) {