authscape 1.0.266 → 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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.266",
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
  {