fedipod 1.49.1 → 1.49.2

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.
@@ -85,7 +85,7 @@ button[hidden]{display:none}
85
85
  return true;
86
86
  }
87
87
 
88
- function sendLoginForm(res, params, error = '', client = null, status = null, headers = {}) {
88
+ function sendLoginForm(res, params, error = '', client = null, status = null, headers = {}, mount = '') {
89
89
  const hidden = [...params.entries()].filter(([k]) => k !== 'password')
90
90
  .map(([k, v]) => `<input type="hidden" name="${escapeHtml(k)}" value="${escapeHtml(v)}">`).join('\n');
91
91
  // Name what is asking, so the owner approves a client they can see rather
@@ -116,7 +116,7 @@ input,button{font:inherit;width:100%;padding:.5rem;margin:.3rem 0;box-sizing:bor
116
116
  <h1>FediPod</h1>
117
117
  ${asking}
118
118
  ${error ? `<p class="err" id="login-err" role="alert">${escapeHtml(error)}</p>` : ''}
119
- <form method="POST" action="/oauth/authorize">
119
+ <form method="POST" action="${escapeHtml(mount)}/oauth/authorize">
120
120
  ${hidden}
121
121
  <label for="password">Agent password</label>
122
122
  <input type="password" id="password" name="password" autofocus autocomplete="current-password"
@@ -580,15 +580,15 @@ export async function handle(api, ctx) {
580
580
  // ask the person to type it again, which is the one thing that
581
581
  // cannot help. Retry-After says how long the wait actually is.
582
582
  return sendLoginForm(res, params, 'too many attempts — wait a minute', client,
583
- 429, { 'retry-after': String(Math.ceil(AUTHZ_WINDOW_MS / 1000)) });
583
+ 429, { 'retry-after': String(Math.ceil(AUTHZ_WINDOW_MS / 1000)) }, api.mount || '');
584
584
  }
585
585
  if (!pw || !checkPassword(pw, body.password || '')) {
586
- return sendLoginForm(res, params, 'wrong password — try again', client);
586
+ return sendLoginForm(res, params, 'wrong password — try again', client, null, {}, api.mount || '');
587
587
  }
588
588
  } else if (pw && !proved) {
589
589
  // The login/approve screen names what is asking before the owner types
590
590
  // the password — a cross-site client cannot forge past that.
591
- return sendLoginForm(res, params, '', client);
591
+ return sendLoginForm(res, params, '', client, null, {}, api.mount || '');
592
592
  } else if (!proved && api.allowed && !api.allowed.isLocalRequest(req) && !api.throughDoor?.(req)) {
593
593
  // With a pod to sign in at, the owner does that instead of a password.
594
594
  if (req.method === 'GET' && ownerWebId) return sendPodSigninPage(res, client, ownerWebId, api.mount || '', ownAddress(api));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fedipod",
3
- "version": "1.49.1",
3
+ "version": "1.49.2",
4
4
  "description": "Standalone single-actor ActivityPub agent whose wire face, RDF truth and state all live on a Solid pod (CSS). Bundles a Phanpy UI and a Mastodon client-API facade.",
5
5
  "type": "module",
6
6
  "license": "MIT",