Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,24 @@ export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspace> {
}

castWorkspaceToAvailableWorkspace(workspace: Workspace) {
let signedLogo: string | undefined = workspace.logo ?? undefined;

if (isDefined(workspace.logo)) {
try {
signedLogo = this.fileService.signFileUrl({
url: workspace.logo as string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant force cast

workspaceId: workspace.id,
});
} catch {
signedLogo = workspace.logo as string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be undefined, wrong force cast

}
}

return {
id: workspace.id,
displayName: workspace.displayName,
workspaceUrls: this.domainManagerService.getWorkspaceUrls(workspace),
logo: workspace.logo,
logo: signedLogo,
sso:
workspace.workspaceSSOIdentityProviders?.reduce(
(acc, identityProvider) =>
Expand Down