academe-kit 0.1.1 → 0.1.2
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.d.ts +3 -0
- package/dist/index.esm.js +7 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/types/components/Button/Button.d.ts +7 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/ProtectedApp/index.d.ts +7 -0
- package/dist/types/components/ProtectedComponent/index.d.ts +6 -0
- package/dist/types/components/ProtectedRouter/index.d.ts +7 -0
- package/dist/types/components/ui/spinner.d.ts +2 -0
- package/dist/types/context/SecurityProvider/index.d.ts +8 -0
- package/dist/types/context/SecurityProvider/types.d.ts +30 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -2259,6 +2259,9 @@ const SecurityContext = React.createContext({
|
|
|
2259
2259
|
email: "",
|
|
2260
2260
|
name: "",
|
|
2261
2261
|
lastName: "",
|
|
2262
|
+
attributes: {
|
|
2263
|
+
school_ids: [],
|
|
2264
|
+
},
|
|
2262
2265
|
}),
|
|
2263
2266
|
signOut: () => null,
|
|
2264
2267
|
goToLogin: () => null,
|
|
@@ -2277,10 +2280,14 @@ const SecurityProvider = ({ hubUrl, children, }) => {
|
|
|
2277
2280
|
window.accessToken = keycloak.token;
|
|
2278
2281
|
}, [keycloak.token]);
|
|
2279
2282
|
const getUser = () => {
|
|
2283
|
+
const idTokenParsed = keycloak?.idTokenParsed || {};
|
|
2280
2284
|
return {
|
|
2281
2285
|
email: keycloak?.idTokenParsed?.email || "",
|
|
2282
2286
|
name: keycloak?.idTokenParsed?.given_name || "",
|
|
2283
2287
|
lastName: keycloak?.idTokenParsed?.family_name || "",
|
|
2288
|
+
attributes: {
|
|
2289
|
+
school_ids: (idTokenParsed.school_ids || []),
|
|
2290
|
+
},
|
|
2284
2291
|
};
|
|
2285
2292
|
};
|
|
2286
2293
|
const redirectToHub = (errorMessage) => {
|