@deix/rossini-core 0.6.2 → 1.0.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.
- package/lib/package.json +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.d.ts +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.d.ts.map +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.js +9 -11
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts +2 -2
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.js +11 -11
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts +3 -3
- package/lib/src/components/layout/components/Sidebar/Sidebar.js +40 -40
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts +3 -3
- package/lib/src/components/layout/components/Topbar/Topbar.js +5 -5
- package/lib/src/utils/hooks/index.d.ts +2 -2
- package/lib/src/utils/hooks/index.js +2 -2
- package/lib/src/utils/hooks/{useKeycloak.d.ts → useUserInfo.d.ts} +2 -3
- package/lib/src/utils/hooks/useUserInfo.d.ts.map +1 -0
- package/lib/src/utils/hooks/useUserInfo.js +32 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/src/utils/hooks/useKeycloak.d.ts.map +0 -1
- package/lib/src/utils/hooks/useKeycloak.js +0 -30
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeycloak.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/useKeycloak.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAuBD,eAAO,MAAM,WAAW,eAAgB,aAAa,wEAKjD,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUserInfo = void 0;
|
|
4
|
-
const react_query_1 = require("react-query");
|
|
5
|
-
const getUserInfo = async (apiClient) => {
|
|
6
|
-
if (apiClient) {
|
|
7
|
-
const fetch = apiClient
|
|
8
|
-
.get('oauth2/userinfo')
|
|
9
|
-
.then((result) => {
|
|
10
|
-
console.log('User Info', result.data);
|
|
11
|
-
return result.data;
|
|
12
|
-
})
|
|
13
|
-
.catch((err) => {
|
|
14
|
-
console.error('Could not get user info');
|
|
15
|
-
console.error(err);
|
|
16
|
-
return {
|
|
17
|
-
email: '',
|
|
18
|
-
user: 'anonymous',
|
|
19
|
-
preferredUserName: 'anonymous',
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
return await fetch;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const useUserInfo = (apiClient) => (0, react_query_1.useQuery)('user-info', () => getUserInfo(apiClient), {
|
|
26
|
-
keepPreviousData: true,
|
|
27
|
-
staleTime: Infinity,
|
|
28
|
-
cacheTime: Infinity,
|
|
29
|
-
});
|
|
30
|
-
exports.useUserInfo = useUserInfo;
|