@knowcode/doc-builder 1.8.0 → 1.8.2
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/.claude/settings.local.json +4 -1
- package/CHANGELOG.md +24 -0
- package/assets/js/main.js +10 -6
- package/html/README.html +43 -5
- package/html/auth.js +61 -12
- package/html/documentation-index.html +43 -5
- package/html/guides/authentication-default-change.html +43 -5
- package/html/guides/authentication-guide.html +50 -9
- package/html/guides/claude-workflow-guide.html +43 -5
- package/html/guides/documentation-standards.html +43 -5
- package/html/guides/phosphor-icons-guide.html +43 -5
- package/html/guides/private-directory-authentication.html +246 -119
- package/html/guides/public-site-deployment.html +43 -5
- package/html/guides/search-engine-verification-guide.html +43 -5
- package/html/guides/seo-guide.html +43 -5
- package/html/guides/seo-optimization-guide.html +43 -5
- package/html/guides/troubleshooting-guide.html +43 -5
- package/html/guides/windows-setup-guide.html +43 -5
- package/html/index.html +43 -5
- package/html/js/auth.js +118 -39
- package/html/js/main.js +10 -6
- package/html/login.html +3 -3
- package/html/logout.html +2 -2
- package/html/private/cache-control-anti-pattern.html +67 -5
- package/html/private/launch/README.html +67 -5
- package/html/private/launch/auth-cleanup-summary.html +67 -5
- package/html/private/launch/bubble-plugin-specification.html +67 -5
- package/html/private/launch/go-to-market-strategy.html +67 -5
- package/html/private/launch/launch-announcements.html +67 -5
- package/html/private/launch/vercel-deployment-auth-setup.html +67 -5
- package/html/private/next-steps-walkthrough.html +67 -5
- package/html/private/supabase-auth-implementation-completed.html +67 -5
- package/html/private/supabase-auth-implementation-plan.html +67 -5
- package/html/private/supabase-auth-integration-plan.html +67 -5
- package/html/private/supabase-auth-setup-guide.html +67 -5
- package/html/private/test-private-doc.html +67 -5
- package/html/private/user-management-tooling.html +587 -0
- package/html/robots.txt +4 -0
- package/html/sitemap.xml +49 -43
- package/html/vercel-cli-setup-guide.html +43 -5
- package/html/vercel-first-time-setup-guide.html +43 -5
- package/lib/config.js +20 -27
- package/lib/core-builder.js +9 -1
- package/lib/shared-auth-config.js +21 -0
- package/lib/supabase-auth.js +20 -14
- package/package.json +1 -1
- package/user-management/README.md +280 -51
- package/user-management/add-users.sh +661 -262
- package/user-management/create-user.js +65 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Helper script to create users using Supabase Admin API
|
|
4
|
+
// This requires the service_role key which has admin privileges
|
|
5
|
+
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const { createClient } = require('@supabase/supabase-js');
|
|
8
|
+
|
|
9
|
+
// Get arguments
|
|
10
|
+
const [,, email, projectUrl, serviceKey] = process.argv;
|
|
11
|
+
|
|
12
|
+
if (!email || !projectUrl || !serviceKey) {
|
|
13
|
+
console.error('Usage: node create-user.js <email> <project-url> <service-role-key>');
|
|
14
|
+
console.error('Example: node create-user.js user@example.com https://xxx.supabase.co YOUR_SERVICE_KEY');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Create Supabase client with service role key
|
|
19
|
+
const supabase = createClient(projectUrl, serviceKey, {
|
|
20
|
+
auth: {
|
|
21
|
+
autoRefreshToken: false,
|
|
22
|
+
persistSession: false
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
async function createUser(email) {
|
|
27
|
+
try {
|
|
28
|
+
// Create user with Admin API
|
|
29
|
+
const { data, error } = await supabase.auth.admin.createUser({
|
|
30
|
+
email: email,
|
|
31
|
+
email_confirm: true,
|
|
32
|
+
// Generate a random password (user will reset it)
|
|
33
|
+
password: Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2).toUpperCase()
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (error) {
|
|
37
|
+
if (error.message.includes('already been registered')) {
|
|
38
|
+
console.log('User already exists');
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.log('User created successfully');
|
|
45
|
+
|
|
46
|
+
// Send password reset email
|
|
47
|
+
const { error: resetError } = await supabase.auth.resetPasswordForEmail(email);
|
|
48
|
+
|
|
49
|
+
if (resetError) {
|
|
50
|
+
console.error('Warning: Could not send password reset email:', resetError.message);
|
|
51
|
+
} else {
|
|
52
|
+
console.log('Password reset email sent');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return true;
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('Error creating user:', error.message);
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Run the function
|
|
63
|
+
createUser(email).then(success => {
|
|
64
|
+
process.exit(success ? 0 : 1);
|
|
65
|
+
});
|