feat(ai): optimize tool loops, fix deployments, and integrate new onboarding flow
This commit is contained in:
37
vibn-frontend/docs/scripts/test_auth.js
Normal file
37
vibn-frontend/docs/scripts/test_auth.js
Normal file
@@ -0,0 +1,37 @@
|
||||
require('dotenv').config({ path: '.env.local' });
|
||||
const { Pool } = require('pg');
|
||||
|
||||
async function test() {
|
||||
console.log("BYPASS_AUTH:", process.env.NEXT_PUBLIC_DEV_BYPASS_PROJECT_AUTH);
|
||||
console.log("LOCAL_EMAIL:", process.env.NEXT_PUBLIC_DEV_LOCAL_AUTH_EMAIL);
|
||||
|
||||
if (!process.env.DATABASE_URL) {
|
||||
console.log("No DATABASE_URL in .env.local");
|
||||
return;
|
||||
}
|
||||
|
||||
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
||||
|
||||
try {
|
||||
const res1 = await pool.query("SELECT id FROM fs_users WHERE data->>'email' = $1 LIMIT 1", [process.env.NEXT_PUBLIC_DEV_LOCAL_AUTH_EMAIL]);
|
||||
if (res1.rows.length === 0) {
|
||||
console.log("FAIL: No user found for email", process.env.NEXT_PUBLIC_DEV_LOCAL_AUTH_EMAIL);
|
||||
return;
|
||||
}
|
||||
const userId = res1.rows[0].id;
|
||||
console.log("User ID:", userId);
|
||||
|
||||
const res2 = await pool.query("SELECT id, slug FROM fs_workspaces WHERE owner_id = $1 LIMIT 1", [userId]);
|
||||
if (res2.rows.length === 0) {
|
||||
console.log("FAIL: User owns no workspaces.");
|
||||
return;
|
||||
}
|
||||
console.log("Workspace found:", res2.rows[0]);
|
||||
console.log("SUCCESS: The bypass SHOULD work.");
|
||||
} catch (e) {
|
||||
console.log("ERROR:", e.message);
|
||||
} finally {
|
||||
pool.end();
|
||||
}
|
||||
}
|
||||
test();
|
||||
Reference in New Issue
Block a user