nca-ai-cms-astro-plugin 1.0.10 → 1.0.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nca-ai-cms-astro-plugin",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -8,6 +8,11 @@ describe('isPublicPath', () => {
8
8
  expect(isPublicPath('/login')).toBe(true);
9
9
  });
10
10
 
11
+ it('allows article-image paths', () => {
12
+ expect(isPublicPath('/api/article-image/123/hero.webp')).toBe(true);
13
+ expect(isPublicPath('/api/article-image/some-slug/hero.webp')).toBe(true);
14
+ });
15
+
11
16
  it('rejects other paths', () => {
12
17
  expect(isPublicPath('/api/generate-content')).toBe(false);
13
18
  expect(isPublicPath('/editor')).toBe(false);
@@ -1,9 +1,10 @@
1
1
  import { getEnvVariable } from './envUtils.js';
2
2
 
3
3
  const PUBLIC_PATHS = ['/api/auth/login', '/api/auth/logout', '/login'];
4
+ const PUBLIC_PATH_PREFIXES = ['/api/article-image/'];
4
5
 
5
6
  export function isPublicPath(pathname: string): boolean {
6
- return PUBLIC_PATHS.includes(pathname);
7
+ return PUBLIC_PATHS.includes(pathname) || PUBLIC_PATH_PREFIXES.some(prefix => pathname.startsWith(prefix));
7
8
  }
8
9
 
9
10
  export function isProtectedPath(pathname: string): boolean {
package/update.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v1.0.11
2
+
3
+ ## Make article-image API route public
4
+ - Added `/api/article-image/` to public path prefixes in auth middleware
5
+ - Article hero images are now accessible without authentication
6
+ - Fixes image loading on public-facing frontend pages
7
+
8
+ ---
9
+
1
10
  # v1.0.8
2
11
 
3
12
  ## Generalize content generator for any topic