@signalk/app-dock 0.3.2 → 0.3.3

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/package.json +1 -1
  2. package/public/dock.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/app-dock",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "macOS-style configurable app dock for switching between SignalK webapps on touch screens",
5
5
  "repository": {
6
6
  "url": "https://github.com/SignalK/app-dock"
package/public/dock.js CHANGED
@@ -80,6 +80,9 @@
80
80
  // /plugins/* is admin-gated. Only logged-in admins can read plugin
81
81
  // settings — anonymous, readonly and readwrite users all 401/403. We set
82
82
  // noAdminAccess accordingly and take the fallback path for all of them.
83
+ // When authenticationRequired is false (no-auth / dummy-security setups),
84
+ // /plugins/* is reachable without a login, so treat the visitor as
85
+ // full-access instead of falling through to the hardcoded fallback list.
83
86
  // Try /skServer/loginStatus first, fall back to the legacy /loginStatus.
84
87
  let noAdminAccess = false
85
88
  for (const url of ['/skServer/loginStatus', '/loginStatus']) {
@@ -87,7 +90,9 @@
87
90
  const res = await fetch(url)
88
91
  if (res.ok) {
89
92
  const data = await res.json()
90
- noAdminAccess = !(data.status === 'loggedIn' && data.userLevel === 'admin')
93
+ const authOff = data.authenticationRequired === false
94
+ const isAdmin = data.status === 'loggedIn' && data.userLevel === 'admin'
95
+ noAdminAccess = !authOff && !isAdmin
91
96
  break
92
97
  }
93
98
  } catch {