@evoke-platform/context 1.5.1-dev.0 → 1.6.0-dev.0

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.
@@ -47,7 +47,6 @@ function MsalProvider({ msal, authRequest, children }) {
47
47
  account: {
48
48
  id: account.localAccountId,
49
49
  name: account.name,
50
- username: account.username,
51
50
  lastLoginTime: (_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.last_login_time,
52
51
  activeMfaSession: Boolean((_b = account.idTokenClaims) === null || _b === void 0 ? void 0 : _b.active_mfa_session),
53
52
  },
@@ -74,7 +73,7 @@ function OidcProvider({ oidcInstance, authRequest, children }) {
74
73
  }, [oidcInstance.user]);
75
74
  // The authRequest for react-oidc is formatted slightly differently than msal.
76
75
  const oidcAuthRequest = {
77
- scope: (_b = (_a = authRequest.scopes) === null || _a === void 0 ? void 0 : _a.join(' ')) !== null && _b !== void 0 ? _b : 'openid profile email',
76
+ scope: (_b = (_a = authRequest.scopes) === null || _a === void 0 ? void 0 : _a.join(' ')) !== null && _b !== void 0 ? _b : 'openid profile',
78
77
  extraQueryParams: authRequest.extraQueryParameters,
79
78
  state: authRequest.state,
80
79
  };
@@ -108,14 +107,13 @@ function OidcProvider({ oidcInstance, authRequest, children }) {
108
107
  });
109
108
  }, [oidcInstance.signinSilent, oidcInstance.signinRedirect, authRequest]);
110
109
  const context = useMemo(() => {
111
- var _a, _b, _c, _d;
110
+ var _a, _b, _c;
112
111
  return oidcInstance.isAuthenticated && userRef.current
113
112
  ? {
114
113
  account: {
115
114
  id: userRef.current.profile.sub,
116
115
  name: (_a = userRef.current.profile.name) !== null && _a !== void 0 ? _a : (`${(_b = userRef.current.profile.given_name) !== null && _b !== void 0 ? _b : ''} ${(_c = userRef.current.profile.family_name) !== null && _c !== void 0 ? _c : ''}` ||
117
116
  undefined),
118
- username: (_d = userRef.current.profile.preferred_username) !== null && _d !== void 0 ? _d : userRef.current.profile.email,
119
117
  lastLoginTime: userRef.current.profile.lastLoginTime,
120
118
  },
121
119
  logout: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/context",
3
- "version": "1.5.1-dev.0",
3
+ "version": "1.6.0-dev.0",
4
4
  "description": "Utilities that provide context to Evoke platform widgets",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",