mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
71504: short-lived token for downloading files through FileService
This commit is contained in:
@@ -546,4 +546,14 @@ export class AuthService {
|
||||
return this.getImpersonateID() === epersonId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a short-lived token for appending to download urls of restricted files
|
||||
* Returns null if the user isn't authenticated
|
||||
*/
|
||||
getShortlivedToken(): Observable<string> {
|
||||
return this.isAuthenticated().pipe(
|
||||
switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user