@commonpub/layer 0.8.7 → 0.8.9

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.
@@ -275,7 +275,8 @@ useJsonLd({
275
275
  class="cpub-related-card"
276
276
  >
277
277
  <div class="cpub-related-card-thumb">
278
- <i class="fa-solid fa-newspaper"></i>
278
+ <img v-if="(item as any).coverImageUrl" :src="(item as any).coverImageUrl" :alt="item.title" class="cpub-related-card-img" />
279
+ <i v-else class="fa-solid fa-newspaper"></i>
279
280
  </div>
280
281
  <div class="cpub-related-card-body">
281
282
  <div class="cpub-related-card-type">{{ item.type }}</div>
@@ -911,6 +912,14 @@ useJsonLd({
911
912
  opacity: 0.3;
912
913
  }
913
914
 
915
+ .cpub-related-card-img {
916
+ width: 100%;
917
+ height: 100%;
918
+ object-fit: cover;
919
+ position: relative;
920
+ z-index: 1;
921
+ }
922
+
914
923
  .cpub-related-card-thumb i {
915
924
  font-size: 22px;
916
925
  color: var(--text-faint);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -53,13 +53,13 @@
53
53
  "vue": "^3.4.0",
54
54
  "vue-router": "^4.3.0",
55
55
  "zod": "^4.3.6",
56
+ "@commonpub/config": "0.9.1",
57
+ "@commonpub/auth": "0.5.1",
56
58
  "@commonpub/docs": "0.6.2",
57
- "@commonpub/learning": "0.5.0",
58
59
  "@commonpub/editor": "0.7.9",
59
- "@commonpub/auth": "0.5.1",
60
+ "@commonpub/ui": "0.8.5",
60
61
  "@commonpub/protocol": "0.9.9",
61
- "@commonpub/config": "0.9.1",
62
- "@commonpub/ui": "0.8.5"
62
+ "@commonpub/learning": "0.5.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/jest-dom": "^6.9.1",
package/pages/explore.vue CHANGED
@@ -539,9 +539,12 @@ const sortOptions = [
539
539
  padding: 24px 0;
540
540
  }
541
541
 
542
+ @media (max-width: 1024px) {
543
+ .cpub-explore-hub-grid { grid-template-columns: 1fr; }
544
+ }
545
+
542
546
  @media (max-width: 768px) {
543
547
  .cpub-explore-grid { grid-template-columns: 1fr; }
544
- .cpub-explore-hub-grid { grid-template-columns: 1fr; }
545
548
  .cpub-explore-filters { flex-wrap: wrap; }
546
549
  }
547
550
  </style>
@@ -33,13 +33,18 @@ export default defineEventHandler(async (event) => {
33
33
  }
34
34
 
35
35
  // Proxy to Better Auth's email sign-in (internal server-side call)
36
- const origin = getRequestURL(event).origin;
36
+ // Forward Origin + Referer so Better Auth's CSRF protection accepts the request
37
+ const requestUrl = getRequestURL(event);
38
+ const origin = requestUrl.origin;
39
+ const clientOrigin = getRequestHeader(event, 'origin') || origin;
37
40
  const response = await $fetch.raw(`${origin}/api/auth/sign-in/email`, {
38
41
  method: 'POST',
39
42
  body: { email, password: body.password },
40
43
  headers: {
41
44
  'Content-Type': 'application/json',
42
45
  Cookie: getRequestHeader(event, 'cookie') ?? '',
46
+ Origin: clientOrigin,
47
+ Referer: getRequestHeader(event, 'referer') || `${clientOrigin}/auth/login`,
43
48
  },
44
49
  });
45
50
 
@@ -110,10 +110,13 @@ export default defineEventHandler(async (event) => {
110
110
  return;
111
111
  }
112
112
 
113
- // Handle auth API routes — skip our custom federated/oauth2 routes (Nitro handles those)
114
- const isBetterAuthRoute = pathname.startsWith('/api/auth')
115
- && !pathname.startsWith('/api/auth/federated/')
116
- && !pathname.startsWith('/api/auth/oauth2/');
113
+ // Handle auth API routes — skip custom routes that Nitro handles directly
114
+ const isCustomAuthRoute = pathname.startsWith('/api/auth/federated/')
115
+ || pathname.startsWith('/api/auth/oauth2/')
116
+ || pathname === '/api/auth/sign-in-username'
117
+ || pathname === '/api/auth/delete-user'
118
+ || pathname === '/api/auth/export-data';
119
+ const isBetterAuthRoute = pathname.startsWith('/api/auth') && !isCustomAuthRoute;
117
120
 
118
121
  if (isBetterAuthRoute) {
119
122
  try {