mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix(server): prevent leaking isFavorite and isArchived info (#7580)
* fix: prevent leaking favorites info * add e2e test * fix: e2e test * fix: isArchived * fix: keep old version
This commit is contained in:
parent
f03381a5b1
commit
ebe7a14c14
5 changed files with 28 additions and 14 deletions
|
|
@ -41,7 +41,7 @@ describe('/album', () => {
|
|||
]);
|
||||
|
||||
[user1Asset1, user1Asset2] = await Promise.all([
|
||||
apiUtils.createAsset(user1.accessToken),
|
||||
apiUtils.createAsset(user1.accessToken, { isFavorite: true }),
|
||||
apiUtils.createAsset(user1.accessToken),
|
||||
]);
|
||||
|
||||
|
|
@ -119,6 +119,17 @@ describe('/album', () => {
|
|||
expect(body).toEqual(errorDto.badRequest(['assetId must be a UUID']));
|
||||
});
|
||||
|
||||
it("should not show other users' favorites", async () => {
|
||||
const { status, body } = await request(app)
|
||||
.get(`/album/${user1Albums[0].id}?withoutAssets=false`)
|
||||
.set('Authorization', `Bearer ${user2.accessToken}`);
|
||||
expect(status).toEqual(200);
|
||||
expect(body).toEqual({
|
||||
...user1Albums[0],
|
||||
assets: [expect.objectContaining({ isFavorite: false })],
|
||||
});
|
||||
});
|
||||
|
||||
it('should not return shared albums with a deleted owner', async () => {
|
||||
const { status, body } = await request(app)
|
||||
.get('/album?shared=true')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue