Skip to content

Embargoed bitstreams thumbnails will not load for authorized users #4165

@ConfusionOrb221

Description

@ConfusionOrb221

There is an issue with embargoed bitstreams when filter-media is ran, the thumbnails will no longer be able to load even if you are signed in and able to view the bitstream.

This is because the request that gets sent to rest to get the bitstream doesn't get the short lived token needed to verify the user.

Think all that really needs to happen here is that inside of resolveThumbnail in thumbnail.component.ts we just add

    this.authService.getShortlivedToken().pipe(take(1)).subscribe((token) => {
      this.src = hasValue(token) ? new URLCombiner(thumbnail._links.content.href, `?authentication-token=${token}`).toString() : thumbnail._links.content.href;
    });

To Reproduce

Create an item with an embargoed bitstream
Run filter-media on the item
The thumbnail will not load even for authorized users

Theres an example item I made on demo here https://demo.dspace.org/entities/publication/2747e0c2-83ed-400c-b225-15b74f659132

Expected behavior

If the user is authorized to see the thumbnail it should appear

Metadata

Metadata

Assignees

Labels

authorizationrelated to authorization, permissions or groupsbugtestathonReported by a tester during Community Testathon

Type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions