@ssplib/react-components 0.0.287 → 0.0.288
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.
|
@@ -61,7 +61,7 @@ function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad', res
|
|
|
61
61
|
else {
|
|
62
62
|
const tokenParsed = keycloak.tokenParsed;
|
|
63
63
|
console.log('TOKEN-> ', tokenParsed);
|
|
64
|
-
const userData = Object.assign(Object.assign({}, tokenParsed), { token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
|
|
64
|
+
const userData = Object.assign(Object.assign({}, tokenParsed), { refreshToken: keycloak.refreshToken, token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
|
|
65
65
|
setUser(userData);
|
|
66
66
|
console.info('Authenticated!!!');
|
|
67
67
|
keycloak.onTokenExpired = () => {
|
package/package.json
CHANGED
package/types/auth.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { KeycloakTokenParsed } from
|
|
1
|
+
import { KeycloakTokenParsed } from 'keycloak-js';
|
|
2
2
|
export interface User extends KeycloakTokenParsed {
|
|
3
3
|
token: string | undefined;
|
|
4
4
|
roles: any[];
|
|
5
5
|
image?: string;
|
|
6
|
+
refreshToken?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface AuthData {
|
|
8
9
|
isAuth: boolean;
|