@rmdes/indiekit-endpoint-activitypub 3.11.3 → 3.11.4

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.
@@ -98,8 +98,13 @@ router.post(
98
98
  try {
99
99
  const { application } = req.app.locals;
100
100
  const collections = req.app.locals.mastodonCollections;
101
+ // Use IndieAuth token stored during OAuth authorization, falling back
102
+ // to session token (native reader) or Mastodon token (won't work for
103
+ // Micropub media endpoint but covers direct internal calls).
101
104
  const token =
102
- req.session?.access_token || req.mastodonToken?.accessToken;
105
+ req.session?.access_token ||
106
+ req.mastodonToken?.indieauthToken ||
107
+ req.mastodonToken?.accessToken;
103
108
 
104
109
  const file = req.files?.file;
105
110
  if (!file) {
@@ -142,8 +147,13 @@ router.post(
142
147
  try {
143
148
  const { application } = req.app.locals;
144
149
  const collections = req.app.locals.mastodonCollections;
150
+ // Use IndieAuth token stored during OAuth authorization, falling back
151
+ // to session token (native reader) or Mastodon token (won't work for
152
+ // Micropub media endpoint but covers direct internal calls).
145
153
  const token =
146
- req.session?.access_token || req.mastodonToken?.accessToken;
154
+ req.session?.access_token ||
155
+ req.mastodonToken?.indieauthToken ||
156
+ req.mastodonToken?.accessToken;
147
157
 
148
158
  const file = req.files?.file;
149
159
  if (!file) {
@@ -388,6 +388,9 @@ router.post("/oauth/authorize", async (req, res, next) => {
388
388
  redirectUri: redirect_uri,
389
389
  codeChallenge: code_challenge || null,
390
390
  codeChallengeMethod: code_challenge_method || null,
391
+ // Store the IndieAuth session token so Mastodon API routes can call
392
+ // Micropub/media endpoints on behalf of this user (single-user server).
393
+ indieauthToken: req.session?.access_token || null,
391
394
  createdAt: new Date(),
392
395
  expiresAt: new Date(Date.now() + 10 * 60 * 1000), // 10 minutes
393
396
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "3.11.3",
3
+ "version": "3.11.4",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",