Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/ssokit-next/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

private static activeRequests = new Map<string, number>();

static requestStart(method: string, url: string, headers?: any, body?: any): string {

Check warning on line 23 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type

Check warning on line 23 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
const requestId = this.generateRequestId();
const timestamp = new Date().toISOString().replace('T', ' ').replace('Z', '');

Expand Down Expand Up @@ -54,7 +54,7 @@
return requestId;
}

static requestEnd(requestId: string, status: number, statusText: string, data?: any, error?: any): void {

Check warning on line 57 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type

Check warning on line 57 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
const startTime = this.activeRequests.get(requestId);
if (!startTime) return;

Expand Down Expand Up @@ -206,7 +206,7 @@
return this.request(`/api/v1/auth/tenants/${orgId}`);
}

async updateOrganization(orgId: string, data: any) {

Check warning on line 209 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
return this.request(`/api/v1/auth/tenants/${orgId}`, {
method: 'PUT',
body: JSON.stringify(data),
Expand All @@ -215,19 +215,19 @@

// Members
async listMembers(orgId: string, params?: Record<string, string>) {
console.log("=== ssojet");
// console.log("=== ssojet");
const query = params ? `?${new URLSearchParams(params).toString()}` : '';
return this.request(`/api/v1/auth/tenants/${orgId}/users${query}`);
}

async addMember(orgId: string, data: any) {

Check warning on line 223 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
return this.request(`/api/v1/auth/tenants/${orgId}/invitations`, {
method: 'POST',
body: JSON.stringify(data),
});
}

async updateMember(orgId: string, memberId: string, data: any) {

Check warning on line 230 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
return this.request(`/api/v1/auth/tenants/${orgId}/invitations/${memberId}`, {
method: 'PATCH',
body: JSON.stringify(data),
Expand All @@ -235,7 +235,7 @@
}

async removeMember(tenantId: string, userId: string) {
console.log('==== Removing member from SSOJetClient', { tenantId, userId });
// console.log('==== Removing member from SSOJetClient', { tenantId, userId });
return this.request(`/api/v1/auth/tenants/${tenantId}/users`, {
method: 'DELETE',
headers: {
Expand All @@ -253,7 +253,7 @@
return this.request(`/api/v1/auth/tenants/${orgId}/invitations${query}`);
}

async createInvite(orgId: string, data: any) {

Check warning on line 256 in packages/ssokit-next/src/client.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
return this.request(`/api/v1/auth/tenants/${orgId}/invitations`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down Expand Up @@ -293,13 +293,13 @@

// Roles
async listRoles() {
console.log('==== Listing roles from SSOJetClient');
//console.log('==== Listing roles from SSOJetClient');
return this.request(`/api/v1/auth/roles`);
}

// Update member roles
async updateMemberRoles(tenantId: string, userId: string, roleIds: string[]) {
console.log('==== Updating member roles from SSOJetClient', { tenantId, userId, roleIds });
//console.log('==== Updating member roles from SSOJetClient', { tenantId, userId, roleIds });
return this.request(`/api/v1/auth/tenants/${tenantId}/users/${userId}/roles`, {
method: 'POST',
headers: {
Expand Down
5 changes: 4 additions & 1 deletion packages/ssokit-team/src/TeamManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export function TeamManager({

// Check if current user has management permissions
const canManageTeam = useMemo(() => {
console.log("== Checking management permissions ==");
console.log("Current User Role:", currentUserRole);
console.log("Allowed Manager Roles:", allowedManagerRoles);
if (!currentUserRole) return false;
return allowedManagerRoles.includes(currentUserRole);
}, [currentUserRole, allowedManagerRoles]);
Expand Down Expand Up @@ -156,7 +159,7 @@ export function TeamManager({
client.listRoles(),
]);

console.log('API Responses:', { membersRes, invitationsRes, rolesRes });
// console.log('API Responses:', { membersRes, invitationsRes, rolesRes });

// Handle users API response format: { users: [...] }
const rawUsers = (membersRes as any)?.users || (membersRes as any)?.data || membersRes || [];
Expand Down
Loading