projoflow-mcp-server 1.1.3 → 1.1.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/index.js +9 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -68,11 +68,18 @@ async function authenticate() {
|
|
|
68
68
|
|
|
69
69
|
// For client tokens, fetch accessible project IDs
|
|
70
70
|
if (authContext.token_type === 'client' && authContext.client_id) {
|
|
71
|
-
|
|
71
|
+
console.error(`Fetching projects for client ${authContext.client_id}...`);
|
|
72
|
+
const { data: projectIds, error: projectError } = await supabase.rpc('get_client_project_ids', {
|
|
72
73
|
p_user_id: authContext.user_id,
|
|
73
74
|
p_client_id: authContext.client_id
|
|
74
75
|
});
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
if (projectError) {
|
|
78
|
+
console.error(`Error fetching projects: ${projectError.message}`);
|
|
79
|
+
}
|
|
80
|
+
console.error(`Raw projectIds response: ${JSON.stringify(projectIds)}`);
|
|
81
|
+
|
|
82
|
+
authContext.accessible_project_ids = Array.isArray(projectIds) ? projectIds : [];
|
|
76
83
|
console.error(`Authenticated as CLIENT via API key (${authContext.accessible_project_ids.length} projects accessible)`);
|
|
77
84
|
} else {
|
|
78
85
|
console.error(`Authenticated via API key for workspace ${authContext.workspace_id}`);
|