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.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -2239,6 +2239,9 @@ const SecurityContext = createContext({
|
|
|
2239
2239
|
email: "",
|
|
2240
2240
|
name: "",
|
|
2241
2241
|
lastName: "",
|
|
2242
|
+
attributes: {
|
|
2243
|
+
school_ids: [],
|
|
2244
|
+
},
|
|
2242
2245
|
}),
|
|
2243
2246
|
signOut: () => null,
|
|
2244
2247
|
goToLogin: () => null,
|
|
@@ -2257,10 +2260,14 @@ const SecurityProvider = ({ hubUrl, children, }) => {
|
|
|
2257
2260
|
window.accessToken = keycloak.token;
|
|
2258
2261
|
}, [keycloak.token]);
|
|
2259
2262
|
const getUser = () => {
|
|
2263
|
+
const idTokenParsed = keycloak?.idTokenParsed || {};
|
|
2260
2264
|
return {
|
|
2261
2265
|
email: keycloak?.idTokenParsed?.email || "",
|
|
2262
2266
|
name: keycloak?.idTokenParsed?.given_name || "",
|
|
2263
2267
|
lastName: keycloak?.idTokenParsed?.family_name || "",
|
|
2268
|
+
attributes: {
|
|
2269
|
+
school_ids: (idTokenParsed.school_ids || []),
|
|
2270
|
+
},
|
|
2264
2271
|
};
|
|
2265
2272
|
};
|
|
2266
2273
|
const redirectToHub = (errorMessage) => {
|