Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ufal/fe-email-restricted-download #430

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
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 @@ -85,7 +85,9 @@ export class ClarinBitstreamDownloadPageComponent implements OnInit {
this.requestService.send(headRequest);

const clarinIsAuthorized$ = this.rdbService.buildFromRequestUUID(requestId);
const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self : undefined);
// Clarin authorization will check dtoken parameter from the request
const dtoken = isNotEmpty(this.dtoken) ? '?dtoken=' + this.dtoken : '';
const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self + dtoken : undefined);
const isLoggedIn$ = this.auth.isAuthenticated();
return observableCombineLatest([clarinIsAuthorized$, isAuthorized$, isLoggedIn$, observableOf(bitstream)]);
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="jumbotron jumbotron-fluid bg-clarin-red rounded">
<div class="container">
<h1 class="display-4 px-3 py-3">The download token is expired, you will be redirected to the download page.</h1>
<h1 class="display-4 px-3 py-3">{{'clarin.bitstream.expired.dtoken.message' | translate}}</h1>
</div>
</div>
4 changes: 4 additions & 0 deletions src/assets/i18n/cs.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,10 @@

// "clarin.license.agreement.notification.cannot.send.email": "Error: cannot send the email.",
"clarin.license.agreement.notification.cannot.send.email": "Error: cannot send the email.",

// "clarin.bitstream.expired.dtoken.message": "The download token is expired, you will be redirected to the download page.",
"clarin.bitstream.expired.dtoken.message": "Platnost tokenu pro stahování vypršel, budete přesměrováni na stránku stahování.",

// "bitstream.download.page.back": "Back" ,
"bitstream.download.page.back" : "Zpět",

Expand Down
3 changes: 3 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@
"clarin.license.agreement.notification.check.email": "You will receive email with download link.",

"clarin.license.agreement.notification.cannot.send.email": "Error: cannot send the email.",

"clarin.bitstream.expired.dtoken.message": "The download token is expired, you will be redirected to the download page.",

"bitstream.download.page.back": "Back" ,


Expand Down