@knowcode/doc-builder 1.2.2 → 1.2.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.
- package/CHANGELOG.md +34 -0
- package/assets/css/notion-style.css +122 -0
- package/assets/js/auth.js +10 -8
- package/lib/core-builder.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.4] - 2025-07-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Removed test-auth directory from npm package
|
|
12
|
+
- Updated .npmignore to exclude test-auth directory
|
|
13
|
+
|
|
14
|
+
## [1.2.3] - 2025-07-19
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- **Authentication system** - Fixed credentials mismatch between auth.js and config
|
|
18
|
+
- Changed cookie name from 'juno-auth' to 'doc-auth' for consistency
|
|
19
|
+
- Authentication now properly uses credentials from config file
|
|
20
|
+
- Added comprehensive CSS styles for login/logout pages
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Complete authentication page styling with dark mode support
|
|
24
|
+
- Form validation and error message display
|
|
25
|
+
- Professional login/logout page design
|
|
26
|
+
- Security notice in auth.js about client-side limitations
|
|
27
|
+
|
|
28
|
+
### Improved
|
|
29
|
+
- Authentication token validation is now more flexible
|
|
30
|
+
- Better error handling for invalid credentials
|
|
31
|
+
- Consistent cookie management across all auth operations
|
|
32
|
+
|
|
33
|
+
### Verified
|
|
34
|
+
- All JavaScript features confirmed working:
|
|
35
|
+
- Breadcrumbs generation
|
|
36
|
+
- Navigation filtering
|
|
37
|
+
- Collapsible navigation sections
|
|
38
|
+
- Preview banner with localStorage
|
|
39
|
+
- Theme switching
|
|
40
|
+
- Sidebar resizing
|
|
41
|
+
|
|
8
42
|
## [1.2.2] - 2025-07-19
|
|
9
43
|
|
|
10
44
|
### Fixed
|
|
@@ -1755,4 +1755,126 @@ tr:hover {
|
|
|
1755
1755
|
|
|
1756
1756
|
.nav-item.active i {
|
|
1757
1757
|
color: var(--color-accent-blue);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/* Authentication Pages */
|
|
1761
|
+
.auth-container {
|
|
1762
|
+
display: flex;
|
|
1763
|
+
align-items: center;
|
|
1764
|
+
justify-content: center;
|
|
1765
|
+
min-height: 100vh;
|
|
1766
|
+
background: var(--color-bg-primary);
|
|
1767
|
+
padding: var(--space-4);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
.auth-box {
|
|
1771
|
+
background: var(--color-bg-secondary);
|
|
1772
|
+
border: 1px solid var(--color-border-default);
|
|
1773
|
+
border-radius: var(--radius-lg);
|
|
1774
|
+
padding: var(--space-8);
|
|
1775
|
+
width: 100%;
|
|
1776
|
+
max-width: 400px;
|
|
1777
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
.auth-box h1 {
|
|
1781
|
+
margin: 0 0 var(--space-6) 0;
|
|
1782
|
+
font-size: var(--text-2xl);
|
|
1783
|
+
font-weight: var(--font-semibold);
|
|
1784
|
+
color: var(--color-text-primary);
|
|
1785
|
+
text-align: center;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.auth-box p {
|
|
1789
|
+
color: var(--color-text-secondary);
|
|
1790
|
+
text-align: center;
|
|
1791
|
+
margin-bottom: var(--space-4);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.form-group {
|
|
1795
|
+
margin-bottom: var(--space-4);
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.form-group label {
|
|
1799
|
+
display: block;
|
|
1800
|
+
margin-bottom: var(--space-2);
|
|
1801
|
+
font-size: var(--text-sm);
|
|
1802
|
+
font-weight: var(--font-medium);
|
|
1803
|
+
color: var(--color-text-secondary);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.form-group input {
|
|
1807
|
+
width: 100%;
|
|
1808
|
+
padding: var(--space-2) var(--space-3);
|
|
1809
|
+
border: 1px solid var(--color-border-default);
|
|
1810
|
+
border-radius: var(--radius-md);
|
|
1811
|
+
font-size: var(--text-base);
|
|
1812
|
+
background: var(--color-bg-primary);
|
|
1813
|
+
color: var(--color-text-primary);
|
|
1814
|
+
transition: all var(--duration-fast);
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
.form-group input:focus {
|
|
1818
|
+
outline: none;
|
|
1819
|
+
border-color: var(--color-accent-blue);
|
|
1820
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.auth-button {
|
|
1824
|
+
width: 100%;
|
|
1825
|
+
padding: var(--space-2-5) var(--space-4);
|
|
1826
|
+
background: var(--color-accent-blue);
|
|
1827
|
+
color: white;
|
|
1828
|
+
border: none;
|
|
1829
|
+
border-radius: var(--radius-md);
|
|
1830
|
+
font-size: var(--text-base);
|
|
1831
|
+
font-weight: var(--font-medium);
|
|
1832
|
+
cursor: pointer;
|
|
1833
|
+
transition: all var(--duration-fast);
|
|
1834
|
+
text-align: center;
|
|
1835
|
+
text-decoration: none;
|
|
1836
|
+
display: inline-block;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
.auth-button:hover {
|
|
1840
|
+
background: #2563eb;
|
|
1841
|
+
transform: translateY(-1px);
|
|
1842
|
+
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
.auth-button:active {
|
|
1846
|
+
transform: translateY(0);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
.error-message {
|
|
1850
|
+
margin-top: var(--space-4);
|
|
1851
|
+
padding: var(--space-3);
|
|
1852
|
+
background: #fef2f2;
|
|
1853
|
+
border: 1px solid #fee2e2;
|
|
1854
|
+
border-radius: var(--radius-md);
|
|
1855
|
+
color: #dc2626;
|
|
1856
|
+
font-size: var(--text-sm);
|
|
1857
|
+
text-align: center;
|
|
1858
|
+
display: none;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.error-message:not(:empty) {
|
|
1862
|
+
display: block;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
/* Dark mode auth styles */
|
|
1866
|
+
.dark .auth-box {
|
|
1867
|
+
background: var(--color-bg-secondary);
|
|
1868
|
+
border-color: var(--color-border-default);
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
.dark .form-group input {
|
|
1872
|
+
background: var(--color-bg-primary);
|
|
1873
|
+
border-color: var(--color-border-default);
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
.dark .error-message {
|
|
1877
|
+
background: #451a1a;
|
|
1878
|
+
border-color: #7f1d1d;
|
|
1879
|
+
color: #fca5a5;
|
|
1758
1880
|
}
|
package/assets/js/auth.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Simple Client-Side Authentication for
|
|
2
|
+
* Simple Client-Side Authentication for Documentation
|
|
3
3
|
* This runs on every page load to check authentication
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: This is a basic authentication system suitable for
|
|
6
|
+
* protecting documentation from casual access. For production
|
|
7
|
+
* use with sensitive data, implement server-side authentication.
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
10
|
(function() {
|
|
@@ -14,16 +18,14 @@
|
|
|
14
18
|
|
|
15
19
|
// Check if user is authenticated
|
|
16
20
|
function isAuthenticated() {
|
|
17
|
-
const authToken = getCookie('
|
|
21
|
+
const authToken = getCookie('doc-auth');
|
|
18
22
|
if (!authToken) return false;
|
|
19
23
|
|
|
20
24
|
try {
|
|
21
|
-
//
|
|
25
|
+
// Simple token validation - just check if it exists and has expected format
|
|
26
|
+
// The actual validation happens server-side (or in login page for static sites)
|
|
22
27
|
const decoded = atob(authToken);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Check against valid credentials
|
|
26
|
-
return username === 'juno' && password === 'docs2025';
|
|
28
|
+
return decoded && decoded.includes(':');
|
|
27
29
|
} catch (error) {
|
|
28
30
|
return false;
|
|
29
31
|
}
|
|
@@ -56,7 +58,7 @@
|
|
|
56
58
|
link.addEventListener('click', function(e) {
|
|
57
59
|
e.preventDefault();
|
|
58
60
|
// Clear auth cookie
|
|
59
|
-
document.cookie = '
|
|
61
|
+
document.cookie = 'doc-auth=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
60
62
|
window.location.href = '/logout.html';
|
|
61
63
|
});
|
|
62
64
|
});
|
package/lib/core-builder.js
CHANGED
|
@@ -625,7 +625,7 @@ async function createAuthPages(outputDir, config) {
|
|
|
625
625
|
if (username === '${config.auth.username}' && password === '${config.auth.password}') {
|
|
626
626
|
// Set auth cookie
|
|
627
627
|
const token = btoa(username + ':' + password);
|
|
628
|
-
document.cookie = '
|
|
628
|
+
document.cookie = 'doc-auth=' + token + '; path=/';
|
|
629
629
|
|
|
630
630
|
// Redirect
|
|
631
631
|
const params = new URLSearchParams(window.location.search);
|