Various fixes: profilePicture / logo upload, imageIdentifiers (#6530)
In this PR: - refactoring auth module to extract a jwt module that can be re-used from other part of the app (avoiding circular dependencies file module => auth => file (file and auth both need jwt actually) - activating imageIdentfier on person on workspace creation (this will put back the images on people) - fixing picture upload (we were missing some fileToken)
This commit is contained in:
@ -70,20 +70,6 @@ export class UserResolver {
|
||||
|
||||
assert(user, 'User not found');
|
||||
|
||||
user.workspaces = await Promise.all(
|
||||
user.workspaces.map(async (userWorkspace) => {
|
||||
if (userWorkspace.workspace.logo) {
|
||||
const workspaceLogoToken = await this.fileService.encodeFileToken({
|
||||
workspace_id: userWorkspace.workspace.id,
|
||||
});
|
||||
|
||||
userWorkspace.workspace.logo = `${userWorkspace.workspace.logo}?token=${workspaceLogoToken}`;
|
||||
}
|
||||
|
||||
return userWorkspace;
|
||||
}),
|
||||
);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@ -186,7 +172,11 @@ export class UserResolver {
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
return paths[0];
|
||||
const fileToken = await this.fileService.encodeFileToken({
|
||||
workspace_id: workspaceId,
|
||||
});
|
||||
|
||||
return `${paths[0]}?token=${fileToken}`;
|
||||
}
|
||||
|
||||
@UseGuards(DemoEnvGuard)
|
||||
|
||||
Reference in New Issue
Block a user