File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
components/server/src/workspace Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,11 @@ export class WorkspaceService {
82
82
async getIDECredentials ( userId : string , workspaceId : string ) : Promise < string > {
83
83
await this . auth . checkPermissionOnWorkspace ( userId , "access" , workspaceId ) ;
84
84
85
- const workspace = await this . doGetWorkspace ( workspaceId ) ;
86
- if ( workspace . config . ideCredentials ) {
87
- return workspace . config . ideCredentials ;
88
- }
89
85
return this . db . transaction ( async ( db ) => {
90
86
const ws = await this . doGetWorkspace ( workspaceId , db ) ;
87
+ if ( ws . config . ideCredentials ) {
88
+ return ws . config . ideCredentials ;
89
+ }
91
90
ws . config . ideCredentials = crypto . randomBytes ( 32 ) . toString ( "base64" ) ;
92
91
await db . store ( ws ) ;
93
92
return ws . config . ideCredentials ;
You can’t perform that action at this time.
0 commit comments