refactor: make adminToken usage clearer

This commit is contained in:
lin onetwo 2023-05-22 01:33:55 +08:00
parent d24a7519f2
commit fdaa9cc48e
4 changed files with 20 additions and 14 deletions

View file

@ -123,13 +123,8 @@ export class WorkspaceView implements IWorkspaceViewService {
});
}
}
let adminToken = '';
if (workspace.tokenAuth) {
logger.debug(`initializeWorkspaceView() generateOneTimeAdminAuthTokenForWorkspace`);
adminToken = this.authService.generateOneTimeAdminAuthTokenForWorkspace(workspace.id);
}
logger.debug(`initializeWorkspaceView() calling wikiStartup()`);
await this.wikiService.wikiStartup(workspace, { adminToken });
await this.wikiService.wikiStartup(workspace);
const userInfo = await this.authService.getStorageServiceUserInfo(workspace.storageService);
const { wikiFolderLocation, gitUrl: githubRepoUrl, storageService, homeUrl } = workspace;