@symbo.ls/router 2.12.13 → 2.12.20

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.
Files changed (2) hide show
  1. package/index.js +11 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -36,20 +36,29 @@ export const router = (
36
36
  lastLevel = options.level
37
37
 
38
38
  const [pathname, hash] = path.split('#')
39
- const routeArray = pathname.split('/')
40
39
  const rootRoute = getActiveRoute(0, path)
40
+ let routeArray = pathname.split('/')
41
41
 
42
42
  if (options.authCheck) {
43
43
  const authRedirect = redirectBasedOnAuth(rootRoute, element, element.state)
44
+ // console.log('authRedirect')
45
+ // console.log(authRedirect)
44
46
 
45
47
  if (authRedirect && rootRoute !== authRedirect) {
46
- routeArray[1] = authRedirect.slice(1)
48
+ routeArray = authRedirect.split('/')
47
49
  }
48
50
  }
49
51
 
50
52
  const route = routeArray.join('/').replace('//', '/')
51
53
  const routeInContent = `/${routeArray[lastLevel + 1] || ''}`
52
54
 
55
+ // console.log('rootRoute')
56
+ // console.log(rootRoute)
57
+ // console.log('route')
58
+ // console.log(route)
59
+ // console.log('routeInContent')
60
+ // console.log(routeInContent)
61
+
53
62
  const content = element.routes[routeInContent] || element.routes['/*']
54
63
 
55
64
  const { context } = element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/router",
3
- "version": "2.12.13",
3
+ "version": "2.12.20",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -11,6 +11,6 @@
11
11
  "@domql/utils": "latest",
12
12
  "@symbo.ls/auth-redirect": "latest"
13
13
  },
14
- "gitHead": "d9b696a77d0481e56b20b69b128e269bbe36e87e",
14
+ "gitHead": "4d1ca55e71877709a79ae02fa3973158d959017c",
15
15
  "source": "index.js"
16
16
  }