@opengeoweb/authentication 12.11.0 → 12.12.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
@@ -947,7 +947,8 @@ var HandleOAuth2Code = function HandleOAuth2Code() {
947
947
  config = {
948
948
  headers: {
949
949
  'content-type': useDefaultContentType ? 'application/json' : 'application/x-www-form-urlencoded'
950
- }
950
+ },
951
+ timeout: 30000
951
952
  };
952
953
  _context.prev = 15;
953
954
  _context.next = 18;
@@ -1244,16 +1245,6 @@ var UserMenuRolesConnect = function UserMenuRolesConnect(_ref) {
1244
1245
  });
1245
1246
  };
1246
1247
 
1247
- var RequireAuth = function RequireAuth(_ref) {
1248
- var children = _ref.children;
1249
- var _useAuthenticationCon = useAuthenticationContext(),
1250
- isLoggedIn = _useAuthenticationCon.isLoggedIn;
1251
- if (!isLoggedIn) {
1252
- window.location.assign('/login');
1253
- }
1254
- return children;
1255
- };
1256
-
1257
1248
  var _excluded = ["children", "createApi", "name"];
1258
1249
  var ApiContext = /*#__PURE__*/React.createContext({
1259
1250
  api: null
@@ -1348,8 +1339,8 @@ params, callbacks) {
1348
1339
  case 5:
1349
1340
  response = _context.sent;
1350
1341
  if (isMounted.current) {
1351
- data = Array.isArray(response) ? response.map(function (d) {
1352
- return d.data;
1342
+ data = Array.isArray(response) ? response.map(function (dimension) {
1343
+ return dimension.data;
1353
1344
  }) : response.data;
1354
1345
  (_callbacksRef$current2 = callbacksRef.current) == null || _callbacksRef$current2.onSuccess == null || _callbacksRef$current2.onSuccess(data);
1355
1346
  setResult(data);
@@ -1396,4 +1387,4 @@ params, callbacks) {
1396
1387
  };
1397
1388
  };
1398
1389
 
1399
- export { AUTH_NAMESPACE, ApiProvider, 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, RequireAuth, UserMenuRoles, UserMenuRolesConnect, apiTranslations, authTranslations, createApiInstance, createFakeApiInstance, createNonAuthApiInstance, fakeApiRequest, getApi, getAuthConfig, getCodeChallenge, getCurrentTimeInSeconds, getCurrentUrlLocation, getRandomString, groupsToRoles, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, useApi, useApiContext, useAuthenticationContext, useAuthenticationDefaultProps };
1390
+ export { AUTH_NAMESPACE, ApiProvider, 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, getApi, getAuthConfig, getCodeChallenge, getCurrentTimeInSeconds, getCurrentUrlLocation, getRandomString, groupsToRoles, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, useApi, useApiContext, useAuthenticationContext, useAuthenticationDefaultProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/authentication",
3
- "version": "12.11.0",
3
+ "version": "12.12.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": "12.11.0",
14
- "@opengeoweb/theme": "12.11.0",
13
+ "@opengeoweb/shared": "12.12.0",
14
+ "@opengeoweb/theme": "12.12.0",
15
15
  "i18next": "^25.0.1",
16
16
  "react-i18next": "^15.1.1",
17
- "@opengeoweb/snackbar": "12.11.0",
17
+ "@opengeoweb/snackbar": "12.12.0",
18
18
  "react-redux": "^9.2.0",
19
19
  "@reduxjs/toolkit": "^2.6.1",
20
20
  "@mui/material": "^7.0.1"
package/src/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export { default as Login } from './lib/components/pages/Login';
5
5
  export { default as Logout } from './lib/components/pages/Logout';
6
6
  export * from './lib/components/UserMenuRoles';
7
7
  export * from './lib/components/AuthenticationContext';
8
- export * from './lib/components/PrivateRoute';
9
8
  export * from './lib/components/ApiContext';
10
9
  export * from './lib/components/apiHooks';
11
10
  export * from './lib/utils/utils';
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface RequireAuthProps {
3
- children: React.ReactElement;
4
- }
5
- export declare const RequireAuth: React.FC<RequireAuthProps>;
6
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './RequireAuth';