@opengeoweb/authentication 15.1.0 → 15.2.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/index.esm.js
CHANGED
|
@@ -92,15 +92,6 @@ function _asyncToGenerator(n) {
|
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
96
|
-
if (null == r) return {};
|
|
97
|
-
var t = {};
|
|
98
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
99
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
100
|
-
t[n] = r[n];
|
|
101
|
-
}
|
|
102
|
-
return t;
|
|
103
|
-
}
|
|
104
95
|
function _regenerator() {
|
|
105
96
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
106
97
|
var e,
|
|
@@ -1350,52 +1341,6 @@ var UserMenuRolesConnect = function UserMenuRolesConnect(_ref) {
|
|
|
1350
1341
|
});
|
|
1351
1342
|
};
|
|
1352
1343
|
|
|
1353
|
-
var _excluded = ["children", "createApi", "name"];
|
|
1354
|
-
var ApiContext = /*#__PURE__*/React.createContext({
|
|
1355
|
-
api: null
|
|
1356
|
-
});
|
|
1357
|
-
var registeredApis = new Map();
|
|
1358
|
-
function registerApi(name, api) {
|
|
1359
|
-
registeredApis.set(name, api);
|
|
1360
|
-
}
|
|
1361
|
-
function getApi(name) {
|
|
1362
|
-
return registeredApis.get(name);
|
|
1363
|
-
}
|
|
1364
|
-
var ApiProvider = function ApiProvider(_ref) {
|
|
1365
|
-
var children = _ref.children,
|
|
1366
|
-
createApi = _ref.createApi,
|
|
1367
|
-
name = _ref.name,
|
|
1368
|
-
apiModuleProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1369
|
-
var handleNewApi = React.useCallback(function () {
|
|
1370
|
-
var newApi = createApi(apiModuleProps);
|
|
1371
|
-
if (name) {
|
|
1372
|
-
registerApi(name, newApi);
|
|
1373
|
-
}
|
|
1374
|
-
return newApi;
|
|
1375
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1376
|
-
}, [createApi, name]);
|
|
1377
|
-
var _React$useState = React.useState(handleNewApi),
|
|
1378
|
-
api = _React$useState[0],
|
|
1379
|
-
setApi = _React$useState[1];
|
|
1380
|
-
React.useEffect(function () {
|
|
1381
|
-
setApi(handleNewApi);
|
|
1382
|
-
return function () {
|
|
1383
|
-
};
|
|
1384
|
-
}, [handleNewApi, name]);
|
|
1385
|
-
var contextValue = React.useMemo(function () {
|
|
1386
|
-
return {
|
|
1387
|
-
api: api
|
|
1388
|
-
};
|
|
1389
|
-
}, [api]);
|
|
1390
|
-
return jsx(ApiContext.Provider, {
|
|
1391
|
-
value: contextValue,
|
|
1392
|
-
children: children
|
|
1393
|
-
});
|
|
1394
|
-
};
|
|
1395
|
-
function useApiContext() {
|
|
1396
|
-
return React.useContext(ApiContext);
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
1344
|
var generateRandomId = function generateRandomId() {
|
|
1400
1345
|
return "-" + Math.random().toString(36).substring(2, 11);
|
|
1401
1346
|
};
|
|
@@ -1493,4 +1438,4 @@ params, callbacks) {
|
|
|
1493
1438
|
};
|
|
1494
1439
|
};
|
|
1495
1440
|
|
|
1496
|
-
export { AUTH_NAMESPACE,
|
|
1441
|
+
export { AUTH_NAMESPACE, AuthenticationContext, AuthenticationProvider, HandleOAuth2Code as Code, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER, KEEP_ALIVE_POLLER_IN_SECONDS, OAuth2Login as Login, OAuth2Logout as Logout, MILLISECOND_TO_SECOND, REFRESH_TOKEN_WHEN_PCT_EXPIRED, UserMenuRoles, UserMenuRolesConnect, apiTranslations, authTranslations, createApiInstance, createFakeApiInstance, createNonAuthApiInstance, fakeApiRequest, getAuthConfig, getCodeChallenge, getCurrentTimeInSeconds, getCurrentUrlLocation, getRandomString, groupsToRoles, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, setAuthChangeListener, useApi, useAuthenticationContext, useAuthenticationDefaultProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/authentication",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.0",
|
|
4
4
|
"description": "GeoWeb authentication library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"axios": "^1.7.7",
|
|
12
12
|
"react-router-dom": "^6.23.1",
|
|
13
|
-
"@opengeoweb/shared": "15.
|
|
14
|
-
"@opengeoweb/theme": "15.
|
|
13
|
+
"@opengeoweb/shared": "15.2.0",
|
|
14
|
+
"@opengeoweb/theme": "15.2.0",
|
|
15
15
|
"i18next": "^25.0.1",
|
|
16
16
|
"react-i18next": "^15.1.1",
|
|
17
|
-
"@opengeoweb/snackbar": "15.
|
|
17
|
+
"@opengeoweb/snackbar": "15.2.0",
|
|
18
18
|
"react-redux": "^9.2.0",
|
|
19
19
|
"@reduxjs/toolkit": "^2.6.1",
|
|
20
20
|
"@mui/material": "^7.0.1"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ApiModule, CreateApiFn } from './types';
|
|
3
|
-
interface ApiContextState<ApiType> {
|
|
4
|
-
api: ApiType;
|
|
5
|
-
}
|
|
6
|
-
declare const ApiContext: React.Context<{
|
|
7
|
-
api: never;
|
|
8
|
-
}>;
|
|
9
|
-
interface ApiProviderProps extends ApiModule {
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
createApi: CreateApiFn;
|
|
12
|
-
}
|
|
13
|
-
export declare function getApi<Type>(name: string): Type;
|
|
14
|
-
export declare const ApiProvider: React.FC<ApiProviderProps>;
|
|
15
|
-
export declare function useApiContext<ApiType>(): ApiContextState<ApiType>;
|
|
16
|
-
export default ApiContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|