Skip to content

Commit

Permalink
Manage members in organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoweiprc committed Sep 12, 2024
1 parent d4bfeb3 commit b80ae5a
Show file tree
Hide file tree
Showing 7 changed files with 1,413 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"*.njson": "ndjson"
},
"files.insertFinalNewline": true,
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"editor.formatOnSaveMode": "modifications",
"editor.defaultFormatter": "vscode.typescript-language-features",
"[json]": {
Expand All @@ -15,4 +15,7 @@
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"cSpell.words": [
"inso"
],
}
6 changes: 4 additions & 2 deletions packages/insomnia/src/account/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface WhoamiResponse {
planId: string;
canManageTeams: boolean;
maxTeamMembers: number;
encryptionEnabled: boolean;
encDriverKey: string;
}

export interface SessionData {
Expand Down Expand Up @@ -54,7 +56,7 @@ export async function absorbKey(sessionId: string, key: string) {
accountId,
firstName,
lastName,
} = await _whoami(sessionId);
} = await whoami(sessionId);
const symmetricKeyStr = crypt.decryptAES(key, JSON.parse(encSymmetricKey));

// Store the information for later
Expand Down Expand Up @@ -160,7 +162,7 @@ export async function setSessionData(
// Helper Functions //
// ~~~~~~~~~~~~~~~~ //

async function _whoami(sessionId: string | null = null): Promise<WhoamiResponse> {
export async function whoami(sessionId: string | null = null): Promise<WhoamiResponse> {
const response = await insomniaFetch<WhoamiResponse | string>({
method: 'GET',
path: '/auth/whoami',
Expand Down
Loading

0 comments on commit b80ae5a

Please sign in to comment.