javascript-solid-server 0.0.69 → 0.0.71

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.
@@ -219,7 +219,8 @@
219
219
  "Bash(__NEW_LINE__ echo \"\")",
220
220
  "WebFetch(domain:webfinger.net)",
221
221
  "Bash(npm update:*)",
222
- "Bash(timeout 8 node:*)"
222
+ "Bash(timeout 8 node:*)",
223
+ "Bash(gh pr view:*)"
223
224
  ]
224
225
  }
225
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -9,6 +9,7 @@ import { checkAccess, getRequiredMode } from '../wac/checker.js';
9
9
  import { AccessMode } from '../wac/parser.js';
10
10
  import * as storage from '../storage/filesystem.js';
11
11
  import { getEffectiveUrlPath } from '../utils/url.js';
12
+ import { generateDatabrowserHtml } from '../mashlib/index.js';
12
13
 
13
14
  /**
14
15
  * Check if request is authorized
@@ -113,6 +114,12 @@ export function handleUnauthorized(request, reply, isAuthenticated, wacAllow, au
113
114
  // Check if browser wants HTML
114
115
  const accept = request.headers.accept || '';
115
116
  if (accept.includes('text/html')) {
117
+ // If mashlib is enabled, serve mashlib instead of static error page
118
+ // Mashlib has built-in login functionality via panes.runDataBrowser()
119
+ if (request.mashlibEnabled) {
120
+ const cdnVersion = request.mashlibCdn ? request.mashlibVersion : null;
121
+ return reply.code(statusCode).type('text/html').send(generateDatabrowserHtml(request.url, cdnVersion));
122
+ }
116
123
  return reply.code(statusCode).type('text/html').send(getErrorPage(statusCode, isAuthenticated, request));
117
124
  }
118
125
 
@@ -315,8 +322,8 @@ function getErrorPage(statusCode, isAuthenticated, request) {
315
322
  <p class="subtitle">${subtitle}</p>
316
323
 
317
324
  <div class="actions">
318
- ${is401 ? `<a href="${baseUrl}/.account/login/password" class="btn btn-primary">
319
- Sign In
325
+ ${is401 ? `<a href="https://solidos.solidcommunity.net/?uri=${encodeURIComponent(baseUrl + request.url)}" class="btn btn-primary">
326
+ Open in Data Browser
320
327
  </a>` : ''}
321
328
  <a href="${baseUrl}/" class="btn btn-secondary">
322
329
  Go to Homepage
@@ -330,7 +337,7 @@ function getErrorPage(statusCode, isAuthenticated, request) {
330
337
  <p>
331
338
  This is a <strong>Solid Pod</strong> — a personal data store where you control your own data.
332
339
  Resources can be private, shared with specific people, or public.
333
- ${is401 ? 'Sign in with your WebID to access protected content.' : 'Ask the owner to grant you access.'}
340
+ ${is401 ? "The Data Browser lets you sign in with your WebID to access protected content." : 'Ask the owner to grant you access.'}
334
341
  </p>
335
342
  </div>
336
343