authscape 1.0.265 → 1.0.268

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.js CHANGED
@@ -58,6 +58,11 @@ function AuthScapeApp(_ref) {
58
58
  if (router.query.r != null) {
59
59
  localStorage.setItem("ref", router.query.r);
60
60
  }
61
+ if (enforceLoggedIn) {
62
+ if (currentUser == null) {
63
+ window.location.href = "/login";
64
+ }
65
+ }
61
66
  }
62
67
  }, [loadedUser]);
63
68
  (0, _react.useEffect)(function () {
@@ -78,7 +83,7 @@ function AuthScapeApp(_ref) {
78
83
  userLoaded: function userLoaded(signedInUser) {
79
84
  setLoadedUser(true);
80
85
  if (enforceLoggedIn && signedInUser == null) {
81
- authService().login();
86
+ // authService().login();
82
87
  } else {
83
88
  if (onAuthenticationLoaded != null) {
84
89
  onAuthenticationLoaded(signedInUser);
@@ -461,6 +466,14 @@ var DocumentManager = function DocumentManager(_ref) {
461
466
  disablePreview = _ref$disablePreview === void 0 ? false : _ref$disablePreview,
462
467
  _ref$openToFolderId = _ref.openToFolderId,
463
468
  openToFolderId = _ref$openToFolderId === void 0 ? null : _ref$openToFolderId,
469
+ _ref$xs = _ref.xs,
470
+ xs = _ref$xs === void 0 ? 12 : _ref$xs,
471
+ _ref$sm = _ref.sm,
472
+ sm = _ref$sm === void 0 ? 6 : _ref$sm,
473
+ _ref$md = _ref.md,
474
+ md = _ref$md === void 0 ? 4 : _ref$md,
475
+ _ref$lg = _ref.lg,
476
+ lg = _ref$lg === void 0 ? 2 : _ref$lg,
464
477
  _ref$overrideLockMess = _ref.overrideLockMessage,
465
478
  overrideLockMessage = _ref$overrideLockMess === void 0 ? "The directory cannot be removed." : _ref$overrideLockMess;
466
479
  var fileUploaderRef = (0, _react.useRef)();
@@ -828,10 +841,10 @@ var DocumentManager = function DocumentManager(_ref) {
828
841
  },
829
842
  item: true,
830
843
  key: index,
831
- xs: 12,
832
- sm: 6,
833
- md: 4,
834
- lg: 2,
844
+ xs: xs,
845
+ sm: sm,
846
+ md: md,
847
+ lg: lg,
835
848
  onClick: function onClick() {
836
849
  return handleFileClick(file);
837
850
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.265",
3
+ "version": "1.0.268",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,6 +26,14 @@ export function AuthScapeApp({Component, pageProps, muiTheme = {}, enforceLogged
26
26
  {
27
27
  localStorage.setItem("ref", router.query.r);
28
28
  }
29
+
30
+ if (enforceLoggedIn)
31
+ {
32
+ if (currentUser == null ) {
33
+ window.location.href = "/login";
34
+ }
35
+ }
36
+
29
37
  }
30
38
  }, [loadedUser]);
31
39
 
@@ -62,7 +70,7 @@ export function AuthScapeApp({Component, pageProps, muiTheme = {}, enforceLogged
62
70
 
63
71
  if (enforceLoggedIn && signedInUser == null)
64
72
  {
65
- authService().login();
73
+ // authService().login();
66
74
  }
67
75
  else
68
76
  {
@@ -24,7 +24,7 @@ import Tooltip from '@mui/material/Tooltip';
24
24
  // remove before merging back
25
25
  // import { FileUploader, apiService, NextImage } from 'authscape';
26
26
 
27
- export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1, disablePreview = false, openToFolderId = null, overrideLockMessage = "The directory cannot be removed."}) => {
27
+ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1, disablePreview = false, openToFolderId = null, xs=12, sm=6, md=4, lg=2, overrideLockMessage = "The directory cannot be removed."}) => {
28
28
 
29
29
  const fileUploaderRef = useRef();
30
30
  const [files, setFiles] = useState(null);
@@ -327,7 +327,7 @@ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1,
327
327
 
328
328
  <Grid onContextMenu={(event) => {
329
329
  handleContextMenu(event, file);
330
- }} item key={index} xs={12} sm={6} md={4} lg={2} onClick={() => handleFileClick(file)}>
330
+ }} item key={index} xs={xs} sm={sm} md={md} lg={lg} onClick={() => handleFileClick(file)}>
331
331
  <Paper
332
332
  sx={{
333
333
  padding: 2,