@xexr/blog-platform 1.0.11 → 1.0.12
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/dist/app/api/blog/publish/route.ts +8 -4
- package/dist/app/api/blog/slugs/[slug]/route.ts +8 -5
- package/dist/app/api/blog/unpublish/route.ts +8 -4
- package/dist/app/api/blog/version/route.ts +8 -4
- package/dist/app/blog/[slug]/page.tsx +7 -1
- package/dist/app/blog/authors/[slug]/page.test.ts +3 -0
- package/dist/app/blog/authors/[slug]/page.tsx +11 -2
- package/dist/app/blog/page.test.ts +45 -0
- package/dist/app/blog/page.tsx +66 -12
- package/dist/components/AuthorPages.test.ts +3 -0
- package/dist/components/AuthorPages.tsx +10 -2
- package/dist/components/TopicArchivePages.test.ts +79 -0
- package/dist/components/TopicArchivePages.tsx +16 -3
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/lib/article-ui.ts +3 -0
- package/dist/lib/auth.ts +6 -2
- package/package.json +1 -1
package/dist/lib/article-ui.ts
CHANGED
|
@@ -37,6 +37,9 @@ export type BlogThemeStyle = CSSProperties & {
|
|
|
37
37
|
"--blog-accent-border": string;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
export const BLOG_PAGE_TITLE_GRADIENT_CLASS =
|
|
41
|
+
"bg-linear-to-br from-[var(--blog-accent-hover)] via-[var(--blog-text-accent)] to-fuchsia-200 bg-clip-text text-transparent";
|
|
42
|
+
|
|
40
43
|
const DEFAULT_THEME: Required<BlogTheme> = {
|
|
41
44
|
accentColor: "hsl(var(--primary))",
|
|
42
45
|
accentHoverColor: "hsl(var(--primary))",
|
package/dist/lib/auth.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type NextRequest } from "next/server";
|
|
2
|
+
import { createHash } from "crypto";
|
|
2
3
|
import type { PublishResult } from "@/types/contracts";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -44,6 +45,10 @@ export interface AuthResult {
|
|
|
44
45
|
context?: Record<string, unknown>;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
export function createTokenFingerprint(token: string): string {
|
|
49
|
+
return `sha256:${createHash("sha256").update(token).digest("hex")}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
/**
|
|
48
53
|
* Default token extraction from Authorization header
|
|
49
54
|
* Supports both "Bearer <token>" and "Token <token>" formats
|
|
@@ -109,8 +114,7 @@ export class ApiKeyAuth implements AuthConfig {
|
|
|
109
114
|
};
|
|
110
115
|
|
|
111
116
|
private hashToken(token: string): string {
|
|
112
|
-
|
|
113
|
-
return token.substring(0, 8) + "...";
|
|
117
|
+
return createTokenFingerprint(token);
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
|