Skip to content

Commit 34b9acc

Browse files
committed
fix
1 parent 9b89fe8 commit 34b9acc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/server/src/workspace/workspace-service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ export class WorkspaceService {
8282
async getIDECredentials(userId: string, workspaceId: string): Promise<string> {
8383
await this.auth.checkPermissionOnWorkspace(userId, "access", workspaceId);
8484

85-
const workspace = await this.doGetWorkspace(workspaceId);
86-
if (workspace.config.ideCredentials) {
87-
return workspace.config.ideCredentials;
88-
}
8985
return this.db.transaction(async (db) => {
9086
const ws = await this.doGetWorkspace(workspaceId, db);
87+
if (ws.config.ideCredentials) {
88+
return ws.config.ideCredentials;
89+
}
9190
ws.config.ideCredentials = crypto.randomBytes(32).toString("base64");
9291
await db.store(ws);
9392
return ws.config.ideCredentials;

0 commit comments

Comments
 (0)