@knowcode/doc-builder 1.7.4 โ†’ 1.7.6

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.
Files changed (71) hide show
  1. package/.claude/settings.local.json +6 -1
  2. package/CHANGELOG.md +50 -0
  3. package/README.md +47 -7
  4. package/RELEASE-NOTES-1.7.5.md +64 -0
  5. package/add-user-clive.sql +35 -0
  6. package/add-user-lindsay-fixed.sql +85 -0
  7. package/add-user-lindsay.sql +68 -0
  8. package/add-user-pmorgan.sql +35 -0
  9. package/add-user-robbie.sql +35 -0
  10. package/add-wru-users.sql +105 -0
  11. package/cli.js +223 -8
  12. package/grant-access.sql +15 -0
  13. package/html/README.html +14 -4
  14. package/html/auth.js +97 -0
  15. package/html/documentation-index.html +14 -4
  16. package/html/guides/authentication-default-change.html +302 -0
  17. package/html/guides/authentication-guide.html +32 -14
  18. package/html/guides/cache-control-anti-pattern.html +361 -0
  19. package/html/guides/claude-workflow-guide.html +14 -4
  20. package/html/guides/documentation-standards.html +14 -4
  21. package/html/guides/next-steps-walkthrough.html +638 -0
  22. package/html/guides/phosphor-icons-guide.html +14 -4
  23. package/html/guides/public-site-deployment.html +363 -0
  24. package/html/guides/search-engine-verification-guide.html +14 -4
  25. package/html/guides/seo-guide.html +14 -4
  26. package/html/guides/seo-optimization-guide.html +14 -4
  27. package/html/guides/supabase-auth-implementation-plan.html +543 -0
  28. package/html/guides/supabase-auth-integration-plan.html +671 -0
  29. package/html/guides/supabase-auth-setup-guide.html +498 -0
  30. package/html/guides/troubleshooting-guide.html +14 -4
  31. package/html/guides/vercel-deployment-auth-setup.html +337 -0
  32. package/html/guides/windows-setup-guide.html +14 -4
  33. package/html/index.html +14 -4
  34. package/html/launch/README.html +14 -4
  35. package/html/launch/bubble-plugin-specification.html +14 -4
  36. package/html/launch/go-to-market-strategy.html +14 -4
  37. package/html/launch/launch-announcements.html +14 -4
  38. package/html/login.html +102 -0
  39. package/html/logout.html +18 -0
  40. package/html/sitemap.xml +69 -21
  41. package/html/vercel-cli-setup-guide.html +14 -4
  42. package/html/vercel-first-time-setup-guide.html +14 -4
  43. package/lib/config.js +33 -29
  44. package/lib/core-builder.js +142 -88
  45. package/lib/supabase-auth.js +295 -0
  46. package/manage-users.sql +191 -0
  47. package/package.json +2 -1
  48. package/public-config.js +22 -0
  49. package/public-html/404.html +115 -0
  50. package/public-html/README.html +149 -0
  51. package/public-html/css/notion-style.css +2036 -0
  52. package/public-html/index.html +149 -0
  53. package/public-html/js/main.js +1485 -0
  54. package/quick-test-commands.md +40 -0
  55. package/recordings/Screenshot 2025-07-24 at 18.22.01.png +0 -0
  56. package/setup-database.sql +41 -0
  57. package/test-auth-config.js +17 -0
  58. package/test-docs/README.md +39 -0
  59. package/test-html/404.html +115 -0
  60. package/test-html/README.html +172 -0
  61. package/test-html/auth.js +97 -0
  62. package/test-html/css/notion-style.css +2036 -0
  63. package/test-html/index.html +172 -0
  64. package/test-html/js/auth.js +97 -0
  65. package/test-html/js/main.js +1485 -0
  66. package/test-html/login.html +102 -0
  67. package/test-html/logout.html +18 -0
  68. package/update-domain.sql +9 -0
  69. package/view-all-users.sql +40 -0
  70. package/wru-auth-config.js +17 -0
  71. /package/{assets โ†’ public-html}/js/auth.js +0 -0
@@ -0,0 +1,40 @@
1
+ # Quick Test Commands for Vercel Deployment
2
+
3
+ ## 1. Update Domain in Supabase
4
+
5
+ Run this SQL in your Supabase SQL Editor:
6
+ ```sql
7
+ UPDATE docbuilder_sites
8
+ SET domain = 'doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app'
9
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
10
+ ```
11
+
12
+ ## 2. Test the Site
13
+
14
+ Visit: https://doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app
15
+
16
+ Login with:
17
+ - Email: `testuser@example.com`
18
+ - Password: `testpass123`
19
+
20
+ ## 3. Check Authentication
21
+
22
+ After login, you should see:
23
+ - "๐Ÿ” Test Documentation with Supabase Auth"
24
+ - "โœ… Authentication is Working!"
25
+
26
+ ## 4. Common Issues
27
+
28
+ If content doesn't show after login:
29
+ - Clear browser cache (Cmd+Shift+R on Mac)
30
+ - Try incognito mode
31
+ - Check browser console for errors
32
+
33
+ ## 5. Production Deployment
34
+
35
+ Once test works:
36
+ ```bash
37
+ vercel --prod
38
+ ```
39
+
40
+ Then update domain in Supabase to production URL.
@@ -0,0 +1,41 @@
1
+ -- Doc-builder Supabase Database Setup
2
+ -- Run this in your Supabase SQL Editor
3
+
4
+ -- Table 1: Documentation sites
5
+ CREATE TABLE docbuilder_sites (
6
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
7
+ domain TEXT UNIQUE NOT NULL,
8
+ name TEXT NOT NULL,
9
+ created_at TIMESTAMPTZ DEFAULT NOW()
10
+ );
11
+
12
+ -- Table 2: User access mapping
13
+ CREATE TABLE docbuilder_access (
14
+ user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
15
+ site_id UUID REFERENCES docbuilder_sites(id) ON DELETE CASCADE,
16
+ created_at TIMESTAMPTZ DEFAULT NOW(),
17
+ PRIMARY KEY (user_id, site_id)
18
+ );
19
+
20
+ -- Enable Row Level Security
21
+ ALTER TABLE docbuilder_sites ENABLE ROW LEVEL SECURITY;
22
+ ALTER TABLE docbuilder_access ENABLE ROW LEVEL SECURITY;
23
+
24
+ -- RLS Policy: Users can only see sites they have access to
25
+ CREATE POLICY "Users see accessible sites" ON docbuilder_sites
26
+ FOR SELECT USING (
27
+ EXISTS (
28
+ SELECT 1 FROM docbuilder_access
29
+ WHERE site_id = docbuilder_sites.id
30
+ AND user_id = auth.uid()
31
+ )
32
+ );
33
+
34
+ -- RLS Policy: Users can see their own access
35
+ CREATE POLICY "Users see own access" ON docbuilder_access
36
+ FOR SELECT USING (user_id = auth.uid());
37
+
38
+ -- Insert a test site for localhost development
39
+ INSERT INTO docbuilder_sites (domain, name)
40
+ VALUES ('localhost:3000', 'Test Documentation Site')
41
+ RETURNING id, domain, name;
@@ -0,0 +1,17 @@
1
+ module.exports = {
2
+ siteName: 'Test Documentation',
3
+ siteDescription: 'Testing Supabase authentication integration',
4
+
5
+ features: {
6
+ authentication: 'supabase',
7
+ darkMode: true,
8
+ mermaid: true,
9
+ changelog: false // Disable for simpler testing
10
+ },
11
+
12
+ auth: {
13
+ supabaseUrl: 'https://xcihhnfcitjrwbynxmka.supabase.co',
14
+ supabaseAnonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY',
15
+ siteId: '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
16
+ }
17
+ };
@@ -0,0 +1,39 @@
1
+ # ๐Ÿ” Test Documentation with Supabase Auth
2
+
3
+ Welcome to the test documentation site! If you can see this page, it means:
4
+
5
+ ## โœ… Authentication is Working!
6
+
7
+ - You successfully logged in with Supabase
8
+ - Your user account has access to this documentation site
9
+ - The JWT token is valid and verified
10
+ - Row Level Security is properly configured
11
+
12
+ ## ๐Ÿงช Test Features
13
+
14
+ ### Secure Access
15
+ This page is protected by enterprise-grade Supabase authentication. Only authorized users can view this content.
16
+
17
+ ### Modern Technology Stack
18
+ - **Frontend**: Generated static HTML with auth checking
19
+ - **Backend**: Supabase authentication and database
20
+ - **Security**: JWT tokens, bcrypt password hashing, RLS policies
21
+
22
+ ### What This Proves
23
+ 1. **Database Setup**: Tables were created correctly
24
+ 2. **Authentication Flow**: Login โ†’ JWT โ†’ Access check โ†’ Content
25
+ 3. **Integration**: doc-builder + Supabase working together
26
+ 4. **Security**: Only authenticated users with proper access can see this
27
+
28
+ ## ๐ŸŽฏ Next Steps
29
+
30
+ Once this test works, we can:
31
+ - Deploy to Vercel with production settings
32
+ - Add more users and documentation sites
33
+ - Set up your real documentation content
34
+ - Configure custom domains and advanced features
35
+
36
+ ---
37
+
38
+ **Generated by**: @knowcode/doc-builder with Supabase authentication
39
+ **Test Date**: July 25, 2025
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Page Not Found - Redirecting...</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
8
+ <style>
9
+ body {
10
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
11
+ margin: 0;
12
+ padding: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ min-height: 100vh;
17
+ background-color: #f7f7f5;
18
+ color: #37352f;
19
+ }
20
+ .container {
21
+ text-align: center;
22
+ padding: 2rem;
23
+ max-width: 600px;
24
+ }
25
+ h1 {
26
+ font-size: 3rem;
27
+ margin: 0 0 1rem 0;
28
+ color: #37352f;
29
+ }
30
+ p {
31
+ font-size: 1.125rem;
32
+ line-height: 1.6;
33
+ color: #6b6b6b;
34
+ margin: 0 0 2rem 0;
35
+ }
36
+ a {
37
+ color: #0366d6;
38
+ text-decoration: none;
39
+ }
40
+ a:hover {
41
+ text-decoration: underline;
42
+ }
43
+ .emoji {
44
+ font-size: 4rem;
45
+ margin-bottom: 1rem;
46
+ }
47
+ .loading {
48
+ display: none;
49
+ color: #0366d6;
50
+ margin-top: 1rem;
51
+ }
52
+ .redirect-message {
53
+ display: none;
54
+ background-color: #e8f4fd;
55
+ border: 1px solid #c3e0f7;
56
+ padding: 1rem;
57
+ border-radius: 8px;
58
+ margin-top: 1rem;
59
+ }
60
+ </style>
61
+ </head>
62
+ <body>
63
+ <div class="container">
64
+ <div class="emoji">๐Ÿ”</div>
65
+ <h1>404</h1>
66
+ <p id="message">The page you're looking for doesn't exist.</p>
67
+ <div id="redirect-message" class="redirect-message">
68
+ Redirecting to the correct page...
69
+ </div>
70
+ <p id="loading" class="loading">Redirecting...</p>
71
+ <p>
72
+ <a href="/" id="home-link">Go to Home</a>
73
+ </p>
74
+ </div>
75
+
76
+ <script>
77
+ // Check if the URL ends with .md
78
+ const pathname = window.location.pathname;
79
+
80
+ if (pathname.endsWith('.md')) {
81
+ // Convert .md to .html
82
+ const htmlPath = pathname.replace(/\.md$/, '.html');
83
+
84
+ // Show redirect message
85
+ document.getElementById('message').textContent = 'Found a markdown link. Redirecting to the HTML version...';
86
+ document.getElementById('redirect-message').style.display = 'block';
87
+ document.getElementById('loading').style.display = 'block';
88
+
89
+ // Redirect after a brief delay to show the message
90
+ setTimeout(() => {
91
+ window.location.replace(htmlPath);
92
+ }, 500);
93
+ } else {
94
+ // For true 404s, show the standard message
95
+ document.getElementById('message').textContent = "The page you're looking for doesn't exist.";
96
+
97
+ // Also check if we can suggest a similar page
98
+ // Remove common suffixes and try to find a match
99
+ const basePath = pathname
100
+ .replace(/\.(html|htm|php|asp|aspx)$/, '')
101
+ .replace(/\/$/, '');
102
+
103
+ if (basePath && basePath !== pathname) {
104
+ document.getElementById('message').innerHTML =
105
+ `The page you're looking for doesn't exist.<br>
106
+ <small>Did you mean <a href="${basePath}.html">${basePath}.html</a>?</small>`;
107
+ }
108
+ }
109
+
110
+ // Update home link to use the correct base URL
111
+ const baseUrl = window.location.origin;
112
+ document.getElementById('home-link').href = baseUrl;
113
+ </script>
114
+ </body>
115
+ </html>
@@ -0,0 +1,172 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="description" content="Welcome to the test documentation site! If you can see this page, it means:">
7
+ <title>๐Ÿ” Test Documentation with Supabase Auth - Test Documentation</title>
8
+
9
+
10
+
11
+ <!-- Fonts -->
12
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
13
+
14
+ <!-- Icons -->
15
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
16
+
17
+
18
+ <!-- Mermaid -->
19
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
20
+
21
+ <!-- Styles -->
22
+ <link rel="stylesheet" href="/css/notion-style.css">
23
+
24
+
25
+ <!-- Hide content until auth check -->
26
+ <style>
27
+ body {
28
+ visibility: hidden;
29
+ opacity: 0;
30
+ transition: opacity 0.3s ease;
31
+ }
32
+ body.authenticated {
33
+ visibility: visible;
34
+ opacity: 1;
35
+ }
36
+ /* Show login/logout pages immediately */
37
+ body.auth-page {
38
+ visibility: visible;
39
+ opacity: 1;
40
+ }
41
+ </style>
42
+
43
+
44
+ <!-- Favicon -->
45
+ <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>โœจ</text></svg>">
46
+
47
+
48
+ </head>
49
+ <body>
50
+ <!-- Header -->
51
+ <header class="header">
52
+ <div class="header-content">
53
+ <a href="/index.html" class="logo">Test Documentation</a>
54
+
55
+ <div class="header-actions">
56
+ <div class="deployment-info">
57
+ <span class="deployment-date" title="Built with doc-builder v1.7.4">Last updated: Jul 25, 2025, 12:27 PM UTC</span>
58
+ </div>
59
+
60
+
61
+ <a href="../logout.html" class="logout-btn" title="Logout">
62
+ <i class="fas fa-sign-out-alt"></i>
63
+ </a>
64
+
65
+
66
+ <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
67
+ <i class="fas fa-moon"></i>
68
+ </button>
69
+
70
+ <button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
71
+ <i class="fas fa-bars"></i>
72
+ </button>
73
+ </div>
74
+ </div>
75
+ </header>
76
+
77
+ <!-- Preview Banner -->
78
+ <div id="preview-banner" class="preview-banner">
79
+ <div class="banner-content">
80
+ <i class="fas fa-exclamation-triangle banner-icon"></i>
81
+ <span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
82
+ <button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
83
+ <i class="fas fa-times"></i>
84
+ </button>
85
+ </div>
86
+ </div>
87
+
88
+ <!-- Breadcrumbs -->
89
+ <nav class="breadcrumbs" id="breadcrumbs">
90
+ <!-- Breadcrumbs will be generated by JavaScript -->
91
+ </nav>
92
+
93
+ <!-- Main Content -->
94
+ <div class="main-wrapper">
95
+ <!-- Sidebar -->
96
+ <aside class="sidebar">
97
+ <div class="sidebar-header">
98
+ <div class="filter-box">
99
+ <input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
100
+ <i class="fas fa-search filter-icon"></i>
101
+ </div>
102
+ </div>
103
+ <nav class="navigation">
104
+
105
+ <div class="nav-section" data-level="0">
106
+ <a class="nav-title expanded" href="/README.html" >
107
+ <i class="fas fa-home"></i> Documentation
108
+ </a>
109
+ <div class="nav-content" >
110
+ <a href="/README.html" class="nav-item active" data-tooltip="๐Ÿ” Test Documentation with Supabase Auth."><i class="fas fa-file-alt"></i> Overview</a></div></div>
111
+ </nav>
112
+ <div class="resize-handle"></div>
113
+ </aside>
114
+
115
+ <!-- Content Area -->
116
+ <main class="content">
117
+ <div class="content-inner">
118
+ <h1><i class="ph ph-lock-key" aria-label="secure"></i> Test Documentation with Supabase Auth</h1>
119
+ <p>Welcome to the test documentation site! If you can see this page, it means:</p>
120
+ <h2><i class="ph ph-check-circle" aria-label="checked"></i> Authentication is Working!</h2>
121
+ <ul>
122
+ <li>You successfully logged in with Supabase</li>
123
+ <li>Your user account has access to this documentation site</li>
124
+ <li>The JWT token is valid and verified</li>
125
+ <li>Row Level Security is properly configured</li>
126
+ </ul>
127
+ <h2>๐Ÿงช Test Features</h2>
128
+ <h3>Secure Access</h3>
129
+ <p>This page is protected by enterprise-grade Supabase authentication. Only authorized users can view this content.</p>
130
+ <h3>Modern Technology Stack</h3>
131
+ <ul>
132
+ <li><strong>Frontend</strong>: Generated static HTML with auth checking</li>
133
+ <li><strong>Backend</strong>: Supabase authentication and database</li>
134
+ <li><strong>Security</strong>: JWT tokens, bcrypt password hashing, RLS policies</li>
135
+ </ul>
136
+ <h3>What This Proves</h3>
137
+ <ol>
138
+ <li><strong>Database Setup</strong>: Tables were created correctly</li>
139
+ <li><strong>Authentication Flow</strong>: Login โ†’ JWT โ†’ Access check โ†’ Content</li>
140
+ <li><strong>Integration</strong>: doc-builder + Supabase working together</li>
141
+ <li><strong>Security</strong>: Only authenticated users with proper access can see this</li>
142
+ </ol>
143
+ <h2><i class="ph ph-target" aria-label="goal"></i> Next Steps</h2>
144
+ <p>Once this test works, we can:</p>
145
+ <ul>
146
+ <li>Deploy to Vercel with production settings</li>
147
+ <li>Add more users and documentation sites </li>
148
+ <li>Set up your real documentation content</li>
149
+ <li>Configure custom domains and advanced features</li>
150
+ </ul>
151
+ <hr>
152
+ <p><strong>Generated by</strong>: @knowcode/doc-builder with Supabase authentication<br><strong>Test Date</strong>: July 25, 2025</p>
153
+
154
+ </div>
155
+ </main>
156
+ </div>
157
+
158
+ <!-- Scripts -->
159
+ <script>
160
+ // Pass configuration to frontend
161
+ window.docBuilderConfig = {
162
+ features: {
163
+ showPdfDownload: true,
164
+ menuDefaultOpen: true
165
+ }
166
+ };
167
+ </script>
168
+ <script src="/js/main.js"></script>
169
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
170
+ <script src="/js/auth.js"></script>
171
+ </body>
172
+ </html>
@@ -0,0 +1,97 @@
1
+
2
+ /**
3
+ * Supabase Authentication for Documentation Site
4
+ * Generated by @knowcode/doc-builder
5
+ */
6
+
7
+ (function() {
8
+ 'use strict';
9
+
10
+ // Skip auth check on login and logout pages
11
+ const currentPage = window.location.pathname;
12
+ if (currentPage === '/login.html' || currentPage === '/logout.html' ||
13
+ currentPage.includes('login') || currentPage.includes('logout')) {
14
+ return;
15
+ }
16
+
17
+ // Initialize Supabase client
18
+ const { createClient } = supabase;
19
+ const supabaseClient = createClient('https://xcihhnfcitjrwbynxmka.supabase.co', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY', {
20
+ auth: {
21
+ persistSession: true,
22
+ autoRefreshToken: true,
23
+ detectSessionInUrl: true
24
+ }
25
+ });
26
+
27
+ // Check authentication and site access
28
+ async function checkAuth() {
29
+ try {
30
+ // Get current user session
31
+ const { data: { user }, error: userError } = await supabaseClient.auth.getUser();
32
+
33
+ if (userError || !user) {
34
+ redirectToLogin();
35
+ return;
36
+ }
37
+
38
+ // Check if user has access to this site
39
+ const { data: access, error: accessError } = await supabaseClient
40
+ .from('docbuilder_access')
41
+ .select('*')
42
+ .eq('user_id', user.id)
43
+ .eq('site_id', '4d8a53bf-dcdd-48c0-98e0-cd1451518735')
44
+ .single();
45
+
46
+ if (accessError || !access) {
47
+ showAccessDenied();
48
+ return;
49
+ }
50
+
51
+ // User is authenticated and has access
52
+ console.log('User authenticated and authorized');
53
+ document.body.classList.add('authenticated');
54
+
55
+ } catch (error) {
56
+ console.error('Auth check failed:', error);
57
+ redirectToLogin();
58
+ }
59
+ }
60
+
61
+ // Redirect to login page
62
+ function redirectToLogin() {
63
+ const currentUrl = window.location.pathname + window.location.search;
64
+ const loginUrl = '/login.html' + (currentUrl !== '/' ? '?redirect=' + encodeURIComponent(currentUrl) : '');
65
+ window.location.href = loginUrl;
66
+ }
67
+
68
+ // Show access denied message
69
+ function showAccessDenied() {
70
+ document.body.classList.add('authenticated'); // Show the body
71
+ document.body.innerHTML = `
72
+ <div style="display: flex; justify-content: center; align-items: center; height: 100vh; font-family: Inter, sans-serif;">
73
+ <div style="text-align: center; max-width: 400px;">
74
+ <h1 style="color: #ef4444; margin-bottom: 1rem;">Access Denied</h1>
75
+ <p style="color: #6b7280; margin-bottom: 2rem;">You don't have permission to view this documentation site.</p>
76
+ <a href="/login.html" style="background: #3b82f6; color: white; padding: 0.75rem 1.5rem; border-radius: 0.5rem; text-decoration: none;">Try Different Account</a>
77
+ </div>
78
+ </div>
79
+ `;
80
+ }
81
+
82
+ // Add logout functionality
83
+ document.addEventListener('DOMContentLoaded', function() {
84
+ const logoutLinks = document.querySelectorAll('a[href*="logout"]');
85
+ logoutLinks.forEach(link => {
86
+ link.addEventListener('click', async function(e) {
87
+ e.preventDefault();
88
+ await supabaseClient.auth.signOut();
89
+ window.location.href = '/logout.html';
90
+ });
91
+ });
92
+ });
93
+
94
+ // Run auth check
95
+ checkAuth();
96
+
97
+ })();